I've tried to find an algorithm (Salesforce, aura) but without success. Probably, you have any ideas!
I have:
- attribute
<aura:attribute name="bulkApply" type="Map" default="{}"/>
- datetime input:
<lightning:input label=""
class="label-hidden"
variant="label-hidden"
type="datetime-local"
value="{!v.bulkApply.SchedStartTime}"
/>
- and time input:
<lightning:input type="time"
label=""
class="label-hidden"
variant="label-hidden"
name="startTimeOnly"
value="{!v.bulkApply.startTimeOnly}"
/>
This is what they look like and what I need to do:
After click the button to action replace logic I have the following values:
let startTimeOnly = cmp.get('v.bulkApply.startTimeOnly');
let schedStartTime = cmp.get('v.bulkApply.SchedStartTime');
console.log(startTimeOnly); //00:30:00.000
console.log(schedStartTime);//2023-02-08T13:00:00.000Z
//here should be algorithm
The main problem is that I have time value with applied user timezone and datatime value in UTC format. Salesforce User timezone is Australia (GMT+11). That is why I have 2023-02-08T13:00:00.000Z instead of 9 Feb, 00:00. Please note, that browser timezone can be differ from salesforce user timezone.