Skip to content

until option with relative values #83

@nikotaf

Description

@nikotaf

I'm getting strange results with relative values. My tests are done in console in Chrome at http://keith-wood.name/countdownBasics.html. I'm pretty sure this is caused by the daylight saving hour, but I'm using relative values, so this shouldn't be the case.
The code I use:

$('#defaultCountdown').countdown('destroy').countdown({
	until:{relative values here},
	format:'odHMS'
}).countdown('pause');

I will only show the relative values and the result

Case 1:

'+0y +1o +1d +1h +1m +1s'

Result: (correct)

1month 1day 1hour 1min 1sec

Case 2:

+0y +2o +1d +1h +1m +1s

Result: (wrong)

2month 1day 0hour 1min 1sec

Case 3: with {timezone:+2} (my timezone)

+0y +1o +1d +1h +1m +1s

Result: (correct)

1month 1day 1hour 1min 1sec

Case 4: with {timezone:+1}

+0y +1o +1d +1h +1m +1s

Result: (wrong)

1month 1day 3hour 1min 1sec

Case 4: with {timezone:-1}

+0y +1o +1d +1h +1m +1s

Result: (wrong)

1month 1day 5hour 1min 1sec

I fully understand, that this is an issue of the daylight saving hour, but it should not be applied to relative values. Some facts need specific time to complete once started, and they don't care for daylight saving time. Why should I have extra or reduced time counted?

I would also like to add that some of the relative values, do not cross the daylight saving hour date.
Current date is September 14, and the said date is at October 29. Most of my tests use 1 month and a day.

Some other test I did with higher in-/decreased relative values, have shown me that, the combination of timezone and more than +1 month (+1o +15d +22h +32m +45s), always increases hour by 1 (gives 1month 15days 23hours 32min 45sec). Without timezone, and month between +2 to +6 (+4o +15d +22h +32m +45s), always decreases hour by 1 (gives 4months 15days 21hours 32min 45sec).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions