-
Notifications
You must be signed in to change notification settings - Fork 198
Due date format
Due date is synonymous with Target date
In this issue was announced about a bug in the target date.
Way 1 - Storage due date, as only date, without time, but with timezone; Way 2 - Storage due date, as only date, without time and without timezone; Way 3 - Storage due date, as date with time.
Wee have three users with three different time zones:
* Juan from Dominican Republic (UTC-4);
* Anatoliy from Ukraine (UTC+3);
* Ari from Australia (UTC +10);
Anatoliy's current time is 17/05/2011 12:00, Anatoliy set task due_date = 18/05/2011.
In this moment:
a) Juan from Dominican Republic (UTC-4) has current time= 17/05/2011 05:00 due date= 17/05/2011, ( oops! )
b) In Database in UTC we have current time = 17/05/2011 09:00 due date= 17/05/2011 21:00,
c) Anatoliy from Ukraine (UTC+3) has current time= 17/05/2011 12:00 due date= 18/05/2011,
d) Ari from Australia (UTC +10) has current time= 17/05/2011 19:00 due date= 18/05/2011.
Conclusion- If Anatoliy set due date to 18/05/2011, Juan does not have any chance to do the task on time.
Juan 17/05/2011 at 10:00 created the task for Ari and set due date to 18/05/2011.
a) Juan from Dominican Republic (UTC-4) has current time= 17/05/2011 10:00 due date=18/05/2011,
b) In Database in UTC we have current time = 17/05/2011 14:00 due date= 18/05/2011,
c) Anatoliy from Ukraine (UTC+3) has current time= 17/05/2011 17:00 due date= 18/05/2011,
d) Ari from Australia (UTC +10) has current time= 18/05/2011 00:00 ( oops! ) due date= 18/05/2011.
Conclusion- If Juan set due date to 18/05/2011, Ari does not have any chance to do the task on time.
Juan 17/05/2011 at 10:00 created the task for Ari and set due date to 18/05/2011 00:00.
a) Juan from Dominican Republic (UTC-4) has current time= 17/05/2011 10:00 due date=18/05/2011 00:00,
b) In Database in UTC we have current time = 17/05/2011 14:00 due date= 18/05/2011 04:00,
c) Anatoliy from Ukraine (UTC+3) has current time= 17/05/2011 17:00 due date= 18/05/2011 07:00,
d) Ari from Australia (UTC +10) has current time= 18/05/2011 00:00 due date= 18/05/2011 14:00 ( OK! ).
Conclusion- If we store due date, as date with time, with timezone, and Juan set due date to 18/05/2011 00:00, Ari have chance to do the task on time.
If we'll store duedate as date + time, we'll can successfully use the method distance_of_time_in_words(). It works well for the 'last comment' in tasks grid list. But with this method duedate will not be shown as 'today', 'tomorrow', it will be shown as 'less than 12 hours', 'one day', 'two days'.