Skip to content
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

Add seconds to Banana start time info #78

Open
ycendes opened this issue May 21, 2015 · 6 comments
Open

Add seconds to Banana start time info #78

ycendes opened this issue May 21, 2015 · 6 comments

Comments

@ycendes
Copy link
Collaborator

ycendes commented May 21, 2015

Currently if you sort images by 'start time' on Banana it only gives you info to the minute. As AARTFAAC does 1s imaging, it would be great if we could have the second displayed as well.

@gijzelaerr gijzelaerr self-assigned this May 21, 2015
@gijzelaerr gijzelaerr added this to the v2.1 milestone May 21, 2015
@gijzelaerr gijzelaerr assigned gijzelaerr and unassigned gijzelaerr May 21, 2015
@gijzelaerr gijzelaerr modified the milestones: v2.1, v3.0 May 28, 2015
@ajstewart
Copy link
Collaborator

Has this already been fixed in any AARTFAAC specific banana?

Otherwise it seems like with USE_L10N = True, the formatting needs to be stated manually. Changing line 56 in image_list.html to

{{ image.taustart_ts|date:"N j, Y, g:i:s a" }}

gives

image-list-seconds

Is that what is wanted here? Though perhaps Gijs knows a better way to set it globally? But I thought I'd post this solution here in case it could be used.

I think also we should perhaps use 24h instead of am/pm.

@gijzelaerr
Copy link
Collaborator

This has not been fixed in any AARTFAAC specific banana. This is a formatting issue and should be set in the template. As far as I know USE_L10N only affects the ordering and formatting of the date and time, but does not add seconds to the representation.

@ajstewart
Copy link
Collaborator

Yeah I thought this could just go in the base.py file but it seemed like USE_L10N was overwriting everything and I could only get it to change when I specified it in the place where it was being shown.

Is there another template file that would do the trick? I'm still learning my way around how the code is set up, so I'd be interested to know.

@gijzelaerr
Copy link
Collaborator

What do you mean? {{ image.taustart_ts|date:"N j, Y, g:i:s a" }} doesn't
seem like a bad solution to me?

2015-07-06 16:49 GMT+02:00 Adam Stewart [email protected]:

Yeah I thought this could just go in the base.py file but it seemed like
USE_L10N was overwriting everything and I could only get it to change when
I specified it in the place where it was being shown.

Is there another template file that would do the trick? I'm still learning
my way around how the code is set up, so I'd be interested to know.


Reply to this email directly or view it on GitHub
#78 (comment).

Gijs Molenaar
http://pythonic.nl

@ajstewart
Copy link
Collaborator

I just meant globally instead of entering that to each html page template? But maybe individually is the way.

@gijzelaerr
Copy link
Collaborator

hm, interesting point.

My first suggestion would be we create a template flag, and then apply that tag everywhere, so you can modify the format in a central location.

What we can also do is add an extra property function to the model the formats the field according to our preference:

http://stackoverflow.com/questions/28269520/django-custom-representation-of-a-field-in-templates

@gijzelaerr gijzelaerr modified the milestones: v3.0, v4.0 Sep 1, 2015
@gijzelaerr gijzelaerr removed their assignment Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants