Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#6960 closed defect (fixed)

Day of Year returns different value on same day

Reported by: [email protected] Owned by: Adam Peller
Priority: high Milestone: 1.2
Component: Date Version: 1.1.1
Keywords: day of year Cc: [email protected]…, Bryan Forbes
Blocked By: Blocking:


call to Date()) returns different value before 1pm EDT due to rounding. This could be resolved by returning Math.ceil(delta) from see attached

Attachments (1)

day of year.png (20.4 KB) - added by guest 14 years ago.

Download all attachments as: .zip

Change History (5)

Changed 14 years ago by guest

Attachment: day of year.png added

comment:1 Changed 14 years ago by bill

Cc: [email protected] removed
Component: GeneralDate
Owner: changed from anonymous to Adam Peller
Reporter: changed from guest to [email protected]

comment:2 Changed 14 years ago by Adam Peller

Cc: [email protected] Bryan Forbes added
Milestone: 1.2

Math.floor, I think? Hrm. Why round instead of floor? And what might we break with this change?

comment:3 Changed 14 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [14132]) Avoid rounding issue in by comparing Date objects with the same hour. Fixes #6960

comment:4 Changed 14 years ago by Adam Peller

Matthew reminded me that sometimes it's perfectly reasonable to round (2 hours 59 minutes might as well be 3 hours) We could have used round or parseInt (truncate, to accomodate negative numbers) but at least we documented our choice properly.

Note: See TracTickets for help on using tickets.