question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Misleading datetime in revert message. Easy fix.

See original GitHub issue

Reversion is a wonderful project, nevertheless I found a subtle bug.

The revert action saves the admin log message “Reverted to previous version, saved on <datetime>”. When the settings.USE_TZ = True, then the code localize(version.revision.date_created) makes the timezone-aware datetime object nicely human readable, but cuts off the UTC timezone info.

I believe the fix is how Django renders the datetimes in templates: localize(timezone.template_localtime(...). Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tuttlecommented, Sep 5, 2016

@arogachev Thanks, Alex. 👍

1reaction
tuttlecommented, Jul 25, 2016

😃 Isn’t this one really a simple change to start a fork for it so I could give you a pull rq?

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Ways to Fix Dates Formatted as Text in Excel
Step 3 of the Wizard: Choose 'Date' from the 'Column Data Format' options and choose your date format from the drop down list...
Read more >
Excel Online date/time displays wrong despite setting Locale in
I do so through OneDrive settings. Specifically `Region Settings > Locale`. According to https://sharepointmaven.com/change-date-format- ...
Read more >
Give warning when wrong datetime field widget is set - Drupal
The fields revert to the core widget which provides a default of "now" if no date is entered. This causes the wrong behavior...
Read more >
Why is My Automatic Date and Time Wrong on Android? 5 ...
Are you struggling because your device shows the wrong date and time? The issue can be caused by bugs or misconfigured date and...
Read more >
How to Fix It When the Time on Your Phone Is Wrong - Lifewire
Restart your Android. · Turn on Android's automatic date/time setting. · Set the time manually. · The wrong time zone setting is a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found