How to configure AEM Datepicker to select UTC datetime instead of local datetime
Hi,
I am using AEM datepicker (granite/ui/components/coral/foundation/form/datepicker) for our Promo component. This is injected into backend java.util.Calendar instance, where we have additional logic for the component. When the date is selected while authoring the page, the datepicker is setting the datetime in local time instead of UTC time. I need the date to be in UTC time. Here are the properties that I have used for datepicker:
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/datepicker"
displayedFormat="MMMM DD, YYYY hh:mm a"
displayTimezoneMessage="{Boolean}true"
fieldLabel="On Time"
name="./onTime"
renderReadOnly="{Boolean}true"
type="datetime"
valueFormat="YYYY-MM-DD[T]HH:mm:ss.000Z"/>
At the backend the datepicker value is injected into a java.util.Calendar instance:
/***
* Promo on time variable.
*/
@Optional
@Inject
private Calendar onTime;
Is there any property that I am missing? How do I get datepicker to set the date in UTC?
Any help or suggestion is greatly appreciated. Thanks!
Regards,
Sophia.