You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the format of the output from the icChange event is a Javascript date, which can depend on locale settings. The proposal is to additionally return the value in UTC format
💬 Description
In the following Stackblitz example, depending on system date settings, is is possible to enter a date but then when converting the value emitted from the date-input\picker to IsoString format, it may return the day before
For example:
There is a workaround as show in that stackblitz to first convert the date to UTC, but it would be nice if the event contained the value in that format
const dateChangedHandler = (event) => {
const val = event.detail.value;
console.log('iso string1 is ', val.toISOString());
const date = new Date(event.detail.value);
const UTC = new Date(
Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())
);
const isoString = UTC.toISOString();
console.log('UTC is ', UTC);
console.log('iso string2 is ', isoString);
the existing value could be returned in addition to the UTC format:
this.icChange.emit({ value: d, utcValue: <the utc format value> });
💰 Use value
It would save users having to convert the date themselves
📝 Acceptance Criteria
If relevant, describe in full detail the different interactions and edge cases that the component or patterns needs to fulfil.
Given a date input\picker When the value is changed Then an event is emitted with the value in UTC format
Additional info
If not implemented in the short term, it would be good to add an example on the site that shows the workaround in the meantime
The text was updated successfully, but these errors were encountered:
Summary
Currently the format of the output from the icChange event is a Javascript date, which can depend on locale settings. The proposal is to additionally return the value in UTC format
💬 Description
In the following Stackblitz example, depending on system date settings, is is possible to enter a date but then when converting the value emitted from the date-input\picker to IsoString format, it may return the day before
For example:
There is a workaround as show in that stackblitz to first convert the date to UTC, but it would be nice if the event contained the value in that format
the existing value could be returned in addition to the UTC format:
💰 Use value
It would save users having to convert the date themselves
📝 Acceptance Criteria
If relevant, describe in full detail the different interactions and edge cases that the component or patterns needs to fulfil.
Given a date input\picker
When the value is changed
Then an event is emitted with the value in UTC format
Additional info
If not implemented in the short term, it would be good to add an example on the site that shows the workaround in the meantime
The text was updated successfully, but these errors were encountered: