Closed afnanz7634 closed 1 year ago
Do you need to set timezone in input? Unfortunately is not possible to do this now. I can try to add this in the next version
Can you describe how do you want that timezone option should work? I created something like this but I'm not sure is that what you need.
<div class="test" style="max-width: 300px">
<input type="text" class="timepicker-ui-input" />
</div>
const test = document.querySelector('.test') as HTMLDivElement;
const testPicker = new TimepickerUI(test, {
clockType: '24h',
});
const options1 = {
timeZone: 'Asia/Shanghai',
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
};
const formatter = new Intl.DateTimeFormat([], options1 as any);
const formatterSplitted = formatter.format(new Date()).split(',')[1];
const formatterJoin = formatterSplitted.split(':').slice(0, -1).join(':');
const inputElement = test.querySelector('input') as HTMLInputElement;
inputElement.value = formatterJoin.trim();
testPicker.create();
Hi I'm using this picker in my application now I need a new requirement to set TimeZone ( ET & PT ) . any help ?