Bug 1044085

Summary: [RFE] make the times and dates displayed in the frontend location aware
Product: [Community] Copr Reporter: Ryan Lerch <rlerch>
Component: frontendAssignee: Miroslav Suchý <msuchy>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ignatenko
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: copr-1.26-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-17 06:18:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch agains master
none
[PATCH] 1044085 - frontend: display time in user timezone none

Description Ryan Lerch 2013-12-17 18:59:53 UTC
FAS has the ability for a fedora account user to set a timezone.

This should be used to offset the times presented in copr, so the times presented to the user are for their chosen timezone.

Comment 1 Igor Gnatenko 2014-01-21 23:42:11 UTC
Created attachment 853506 [details]
Proposed patch agains master

I really can't undersand how flask works. but I think this code should works.

Comment 2 Miroslav Suchý 2014-01-22 18:21:28 UTC
Igor. This is just change in template, but we first need to retrieve those data:
 * coprs_frontend/coprs/views/misc.py:login() add to ask_for=[] "timezone"
   see http://pythonhosted.org/Flask-OpenID/ for documentation of try_login()
 * you need to store it db (change model of User)
 * create migration script which will add that column into existing db.

Would you like to finish it?
For testing purposes just create frontend (just follow copr-setup.txt) and put some dummy data in db. You do not actually need backend to test it.

Comment 3 Igor Gnatenko 2014-01-22 18:25:00 UTC
Sure, I want ;)
I will try to implement this.

Comment 4 Igor Gnatenko 2014-01-23 08:27:32 UTC
Created attachment 854245 [details]
[PATCH] 1044085 - frontend: display time in user timezone

Unfortunately, I have very bad internet today and I can't test it :(

Comment 5 Miroslav Suchý 2014-01-28 01:26:09 UTC
Your patch commited as 5f03d48

Some additional fixes and changes in commits:
* c702e27 fix colision of revision id
* 3fcfc20 [db] timezone can be nullable
* 079053e [frontend] actually save the timezone to model
* ef3eb03 1044085 - move timezone modification out of template and make it actually work
* 84da5ba add date to data for test builds
* 7a00a3c rename tests to avoid confuse
* 8d35cf1 lower testing date
* c9ea250 move localized_time into filters

Thanks for contributing Igor.

Comment 6 Igor Gnatenko 2014-03-17 06:18:43 UTC
Already in production