phonegap-desktop icon indicating copy to clipboard operation
phonegap-desktop copied to clipboard

great job.

Open meadlai opened this issue 12 years ago • 6 comments

but any detail usage?

meadlai avatar Jul 09 '12 11:07 meadlai

This bug is reproducible without changing computer timezones like this:

const chrono = require("chrono-node")
const now = new Date("2024-02-21T10:00:00+1300") // New Zealand Time
const parsed = chrono.parseDate("yesterday 18:00", { instant: now.valueOf(), timezone: 780 }) // Can also use "NZDT" for timezone, same results
const yesterday = parsed.toLocaleString("nz", {timeZone: "Pacific/Auckland"})
console.log(yesterday) // 2/19/2024, 6:00:00 PM     // Expected: 2/20/2024, 6:00:00 PM

vividn avatar Feb 21 '24 14:02 vividn

+1

ivan-bialotski-sm avatar Apr 26 '24 08:04 ivan-bialotski-sm

Hello. I'm sorry for my slow reply.

I have recently tested the scenario that @vividn described (fdcfde0), and the issue should have already been fixed.

wanasit avatar Jun 01 '24 08:06 wanasit

Sorry. I made a mistake.

The test will still fail we are testing in the timezone that sees the reference date as the day before (e.g. in UTC "2024-02-21T10:00:00+1300" is "2024-02-20", thus yesterday is 19).

wanasit avatar Jun 01 '24 10:06 wanasit

also been running into this, but from what I'm seeing, (hopefully useful context): one of the following things is broken, but the other works; until they switch expected outcomes completely:

  1. relative times [tomorrow at 9pm, today at 9pm, yesterday at 9pm] (these will return the correct clock time but not date (it will be 24 hours off), if broken

  2. day of week date times [wednesday at 9pm, thursday at 9pm], also return the correct clock time, but not date (it will be 24 hours off), if broken

When one works, the other is broken.

Then at a particular time, which seems to be based on system clock TZ (my expected results started inverting at 6pm MDT, which would be utc midnight for me), the working and broken one flip their expected results (the first starts working the second breaks)

jasonayre avatar Jun 04 '24 01:06 jasonayre