@@ -228,21 +228,21 @@ export function updateFormatted (timestamp) {
228228
229229export function getDayOfYear ( timestamp ) {
230230 if ( timestamp . year === 0 ) return
231- const ts = new Date ( timestamp . year , timestamp . month - 1 , timestamp . day )
231+ const ts = new Date ( Date . UTC ( timestamp . year , timestamp . month - 1 , timestamp . day , 0 , 0 ) )
232232 return date . getDayOfYear ( ts )
233233}
234234
235235export function getWorkWeek ( timestamp ) {
236236 if ( timestamp . year === 0 ) return
237- const ts = new Date ( timestamp . year , timestamp . month - 1 , timestamp . day )
237+ const ts = new Date ( Date . UTC ( timestamp . year , timestamp . month - 1 , timestamp . day , 0 , 0 ) )
238238 return date . getWeekOfYear ( ts )
239239}
240240
241241export function getWeekday ( timestamp ) {
242242 // [bug] this code has issues. If 1st day of the month is 1 day of week
243243 // it comes back with day of week as 7.
244244 // if (timestamp.hasDay) {
245- // const ts = new Date(timestamp.year, timestamp.month - 1, timestamp.day)
245+ // const ts = new Date(Date.UTC( timestamp.year, timestamp.month - 1, timestamp.day, 0, 0) )
246246 // return date.getDayOfWeek(ts)
247247 // }
248248
@@ -430,7 +430,8 @@ export function createNativeLocaleFormatter (locale, getOptions) {
430430 const intlFormatter = new Intl . DateTimeFormat ( locale || void 0 , getOptions ( timestamp , short ) )
431431 // const time = `${padNumber(timestamp.hour, 2)}:${padNumber(timestamp.minute, 2)}`
432432 // const date = timestamp.date
433- return intlFormatter . format ( new Date ( timestamp . year , timestamp . month - 1 , timestamp . day , timestamp . hour , timestamp . minute ) )
433+ // return intlFormatter.format(new Date(`${date}T${time}:00+00:00`))
434+ return intlFormatter . format ( new Date ( Date . UTC ( timestamp . year , timestamp . month - 1 , timestamp . day , timestamp . hour , timestamp . minute ) ) )
434435 } catch ( e ) {
435436 return ''
436437 }
0 commit comments