-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Closes #5503: ISO 8601 date in UI and alternative format as tooltip #5764
Closes #5503: ISO 8601 date in UI and alternative format as tooltip #5764
Conversation
There seems to be a lot of repetition here, do you think it might be possible to create an include and pass the date, it would also make future modifications easier. |
f3aba08
to
3db3c14
Compare
Thanks for the pointer (am was/am new to Django), done. The only place (that I know of, and I also greped the source and so on) with dates without tooltip is |
3db3c14
to
e17417b
Compare
I rebased and updated this patch to the latest develop branch. Some new date fields were introduced with NetBox 2.11. I hope I found all of them by greping the source. If not, it is not the end of the world. I will come across them eventually and fix them (potentially in a new PR). I applied this patch (including the dependency patch 2618dde) on my instance now for testing during regular use. I tested all modified pages manually already. Feel free to have a look. |
e17417b
to
6e89d6b
Compare
I have been using this ever since and did not run into dates that I missed nor other issues. I would say this is ready. @jeremystretch Can you have a look? |
@ypid Adding inclusion tags to display a value (i.e. |
36cfa0c
to
01c7d50
Compare
I improved it, thanks. I agree with you that your approach is better. Now with the |
27738bd
to
3378d51
Compare
8aa427f
to
95b2c98
Compare
…mat as tooltip With this commit all dates in the UI are now consistently displayed. I changed the long date format as suggested by @xkilian and confirmed by my own research. * DATETIME_FORMAT * Before July 20, 2020 4:52 p.m. * Now 20th July, 2020 16:52 "20th July, 2020" would be spoken as "the 20th of July, 2020" but the "the" and "of" are never written. The only exception is `object_list.html`. I tried it but there it does not work so easily because the dates are passed to Jinja as SafeString.
This changes the text from: Updated 5 months, 1 week ago to: Updated 2021-01-24 00:33 (5 months, 1 week ago) Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
95b2c98
to
f331f10
Compare
@jeremystretch: > It'd be better to have the custom field return a date object than to > accommodate string values in the template filter. Let's just omit custom > field dates for now to keep this from getting any more complex.
f331f10
to
a479c86
Compare
Done. |
Fixes: #5503
With this PR all dates in the UI are now consistently displayed.
I changed the long date format as suggested by @xkilian and confirmed by my own research.
"20th July, 2020" would be spoken as "the 20th of July, 2020" but the "the" and "of" are never written.
I also switch from the illogical a.m./p.m. time format to military time format that can be pronounced as "sixteen hundred and fifty-two".