Open roma2341 opened 9 months ago
If anybody needs this library in local time instead of UTC I created this package as a temporary solution until the authors provide a logic to set any timezone: https://www.npmjs.com/package/ngx-daterangepicker-material-no-utc
Same problem, the downgraded version to 5 is fine. May I ask when the new version will be repaired
My solution of this problem. I write value from datepicker using this function.
function getDate(date: dayjs.Dayjs): string {
return dayjs(
date?.format('YYYY-MM-DD HH:mm:ss'),
'YYYY-MM-DD HH:mm:ss',
)
.format('YYYY-MM-DDTHH:mm:ssZ');
}
As far as I understand, problem in uncorrect UTC, because in library utc is hard coded in zero zone. If do something like this, dateFromPicker.local().format()
- we get not present time in locale zone, but get zero utc time in our time zone. Or something)))
I think it would be better if datepicker had flag isUtc
. Default it can be true
.
it should return values in local timezone. But instead it adds +3 hours. My timezone is (+3). So when I pick 19:00. It saves it as 19:00(But in UTC, not in my timezone). And js date show me 22:00 because of that. Why ? and how to fix this behavior to make it like version 5 ?