New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timestamp weirdness: multiplying minutes by 100 then truncating causes strange behaviour #1502
Comments
18:10 < AlexSeanchai> wait hold up a minute. the bug where a timestamp of 12:03 shows up as a timestamp of 12:30? if the timestamp is actually 12:09, and therefore shows as 12:90, would that actually show as 01:30? because uh. that makes sense as a thing that happened to http://alexseanchai.dreamwidth.org/950691.html NB I think this is happening for two (or more) posts made "close together" (for some value of "close together", not sure what) when the use-time-of-posting box is checked by default |
This in fact has nothing to do with the "sticky-ticky", except it is triggering the bug. The code for "Use current time" inexplicably multiplies the minutes by 100 before zero-padding the number to two digits. I am assuming some later code grabs the first 2 digits for the hour, some seperator, and then the next two digits for the minute. 11:09 ends up as 11:900. Which then ends up as 11:90 ( or 12:30 ) Observe: ( To reproduce, I turned on the "Display Date" panel, removed maxsize from the time field using Inspect Element in chrome, and manually modifying that field ) |
That .... is really really weird. Where is it doing that and when was it started? |
The change appears to date from last fall, when the beta update page was converted to Foundation. I found it in In
I'm completely confused, because the zeropad function prepends a zero to any number less than ten, but multiplying the number of minutes by 100 ensures it will never be less than ten... I think just removing the |
Paging @afuna to see if she remembers why that was done that way!
|
No clue sadly! Probably just a bug that crept in. |
Okay! I figured I'd check first to see if it had been deliberate for some reason :) |
The lion's share of the credit for this fix goes to AlexSeanchai for pattern recognition and exor674 for diagnosing. Fixes dreamwidth#1502.
[#1502] in setTimeToNow(), don't multiply minutes by 100
Dre has diagnosed the problem (see comments). Apparent lack of in-code comments, however, means it is not immediately apparent why we're doing this or what will break if we stop. Nonetheless it should probably be fixed.
We've had several reports now of weird stuff going on with timestamps for people using the "Use time entry is posted" checkbox on the Create Entries beta since the sticky-ticky was introduced.
Support request: " Sometimes (possibly related to the above, as it happens every time I compose two posts one after the other) a post will get a future time stamp. I think, but I'm not sure, that it gets marked into the future by the same interval as it took me to compose the post. (i.e. if I started composing a post at 12:00 and posted at 12:45, the post will get tagged with 13:30.)" (http://www.dreamwidth.org/support/see_request?id=31153)
Conversation in IRC:
07:05 < AlexSeanchai> see http://alexseanchai.dreamwidth.org/946340.html which says posted at 01:50 am? I posted it at 01:05.
07:06 < AlexSeanchai> right before I clicked post, the timestamp box of course had the time at which I opened the post window. which was actually 01:02, but the box said 01:20.
07:06 < AlexSeanchai> single-digit minute numbers are showing in the tens column instead of the ones column.
07:06 < AlexSeanchai> how to fix is beyond me.
07:09 < AlexSeanchai> ...that is to say, I figured out a problem with my freaking timestamps. I was gonna post another post to test, editing after 1:10 hits, but the timestamp box on the update page says 02:30. dunno where that came from.
I've also observed some weirdnesses but haven't had the cope/brain to work out what on earth is going on. Filing per @rahaeli's comment over in dw-dev in the interests of diagnosing what the problem is.
The text was updated successfully, but these errors were encountered: