folletto / Blipshot

Google Chrome Extension to make screenshots
intenseminimalism.com
114 stars 19 forks source link

Bug: Wrong day in filename date #19

Closed oestrogen closed 6 years ago

oestrogen commented 6 years ago

The day in the filename is off by a semi-random number of days.

I.e, screenshots taken today, the 28th of August 2018, are named pageshot of 'WFM' @ 2018-08-02-1016'57.png, but screenshots taken on the 24th were named pageshot of 'WFM' @ 2018-08-05-1534'52.png.

folletto commented 6 years ago

You're right, I can reproduce.

I dug the bug... the function uses Date.getDay() which I thought referred to the day of the month, but it refers to the day of the week... and to get the day of the month one has to use (drumroll)... Date.getDate() which also compared to Date.getMonth() starts at 1 instead of 0.

I'm seriously facepalming at the API design of this class.

folletto commented 6 years ago

Pushed a fix in 1.2.3.