fix: fix timezone offset bug for datepicker
only applies when user manually keys in a date.. hopefully this is a sufficient fix..but it does not actually make sense to me yet, so we'll see..
This commit is contained in:
parent
3274553557
commit
749aca560a
|
@ -339,9 +339,15 @@
|
||||||
}
|
}
|
||||||
// just need to convert to simple ISO date format here, seems
|
// just need to convert to simple ISO date format here, seems
|
||||||
// like there should be a more obvious way to do that?
|
// like there should be a more obvious way to do that?
|
||||||
var year = date.getFullYear()
|
// nb. also, not sure if/what i am missing here but
|
||||||
var month = date.getMonth() + 1
|
// when user keys in a date, the component must assume
|
||||||
var day = date.getDate()
|
// UTC (?) but the value passed to this method may be
|
||||||
|
// offset in such a way that a *different date* is
|
||||||
|
// implied! hence we must convert back to UTC when
|
||||||
|
// isolating each part.. *shrug*
|
||||||
|
var year = date.getUTCFullYear()
|
||||||
|
var month = date.getUTCMonth() + 1
|
||||||
|
var day = date.getUTCDate()
|
||||||
month = month < 10 ? '0' + month : month
|
month = month < 10 ? '0' + month : month
|
||||||
day = day < 10 ? '0' + day : day
|
day = day < 10 ? '0' + day : day
|
||||||
return year + '-' + month + '-' + day
|
return year + '-' + month + '-' + day
|
||||||
|
|
Loading…
Reference in a new issue