Opened 19 years ago
Closed 15 years ago
#1061 closed defect (fixed)
Start week day on calendar
Reported by: | Owned by: | Jannis Leidel | |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | minor | Keywords: | i18n-fixed |
Cc: | Triage Stage: | Fixed on a branch | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I thinks this is an issue of internationalization.
The calendar widget starts the week on Sunday but in some countries (Spain for example) the week starts on Monday. On the other hand I haven't seen any way to change the date display format on the admin application, it displays 2005-12-14 instead of 14-12-2005 or 14/12/2005 which would be the default locale for Spain.
Attachments (3)
Change History (34)
comment:1 by , 19 years ago
milestone: | → Version 0.92 |
---|---|
Severity: | normal → major |
Type: | enhancement → defect |
comment:2 by , 19 years ago
milestone: | Version 0.92 |
---|---|
Severity: | major → normal |
comment:3 by , 19 years ago
priority: | normal → lowest |
---|---|
Severity: | normal → minor |
comment:4 by , 18 years ago
I can name already three countries where the first day of the week is: Saturday, Sunday, and Monday. So that WEEK_STARTS_MONDAY switch needs to be a bit more configurable than that.
comment:5 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:6 by , 17 years ago
Component: | Admin interface → HTTP handling |
---|---|
Keywords: | SUNDAY added |
Needs documentation: | set |
Patch needs improvement: | set |
Resolution: | → fixed |
Status: | new → closed |
Triage Stage: | Design decision needed → Accepted |
comment:7 by , 17 years ago
Component: | HTTP handling → Admin interface |
---|---|
Description: | modified (diff) |
Keywords: | SUNDAY removed |
Needs documentation: | unset |
Patch needs improvement: | unset |
Resolution: | fixed |
Status: | closed → reopened |
reverting spam.
comment:8 by , 17 years ago
What about: WEEK_START_DAY = 0-6 ? Monday == 0 ... Sunday == 6 as in datetime?
comment:9 by , 17 years ago
It's a matter of convention, so getting the datetime one is as good as any other one.
comment:10 by , 17 years ago
It's more complicated than that, there are regional settings usually that let users select from a week numbering scheme (first full week after start of month = first week, first week that crosses nye = first week, week starts on monday, week starts on sunday)
http://en.wikipedia.org/wiki/Week#Week_number
http://en.wikipedia.org/wiki/ISO_week_date
I used to have a better link but can't seem to find it atm
comment:11 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
by , 17 years ago
Attachment: | calendar.diff added |
---|
Implemented WEEK_START_DAY and a little change to the calendar javascript code
comment:12 by , 17 years ago
Has patch: | set |
---|
comment:13 by , 17 years ago
I have applied the patch but it does not work for me, it simply makes calendar not appear anymore :(
by , 17 years ago
Attachment: | calendar2.diff added |
---|
Refactored patch for use with DateField, DateTimeField and TimeField, please patch a fresh checkout
comment:17 by , 17 years ago
Keywords: | sprintdec01 added |
---|
comment:18 by , 16 years ago
Component: | Admin interface → Internationalization |
---|---|
Keywords: | i18n admin added; sprintdec01 removed |
milestone: | → 1.0 beta |
Owner: | changed from | to
Patch needs improvement: | set |
I think that the patch is too much complicated to achieve it (and probably commiters agree, so it hasn't been commited for several months).
I'll develop a better patch, and try to have this feature on 1.0.
I know that this is not explicitly in Jacob's maybe list, but I thing that if a good patch exists when 1.0 beta, it should be included, so tagging it as 1.0 beta.
comment:20 by , 16 years ago
Replying to jezdez:
Ehm, why do you think my patch is complicated?
I think that your patch can be improved easily, and following more "django standards". It's a good job, because you pointed out where the problem is, and how to fix this situation, but I think that a better patch is necessary.
I explained more clearly how my patch will be in the next thread:
http://groups.google.com/group/django-developers/browse_thread/thread/db149543262b5b21/c51f020880badf41#c51f020880badf41
Don't take it personally, for sure you'll be able to improve my patch as well... :)
comment:21 by , 16 years ago
Keywords: | i18n-rf added |
---|
by , 16 years ago
Fix and example of how djangojs.po files should be updated to work on every language
comment:22 by , 16 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
New patch fixes this issue using standard django's way to specify date formats... that is creating settings as strings on code, and marking them for gettext translation.
If the patch is commited, the djangojs.po file should be excluded. I've attached it just for showing how the patch will work.
The behaviour of admin calendar based on this patch, will be to set first day of week based on current language. If no setting is found, then it will be used default application language setting, then english setting, and finally Sunday.
comment:25 by , 16 years ago
milestone: | → post-1.0 |
---|
comment:26 by , 16 years ago
I think there is a mistake in your patch yet.
There is an additional change you must do, because the patch fixes the calendar header, but not the number positions. So you must include an additional change, on line 64:
var startingPos = new Date(year, month-1, 1).getDay()-CalendarNamespace.firstDayOfWeek;
comment:28 by , 15 years ago
Keywords: | i18n-fixed added; i18n admin i18n-rf removed |
---|---|
Triage Stage: | Ready for checkin → Accepted |
Fixed in branches/soc2009/i18n-improvements.
comment:29 by , 15 years ago
Triage Stage: | Accepted → Fixed on a branch |
---|
comment:30 by , 15 years ago
Owner: | changed from | to
---|
comment:31 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [11964]) Fixed #7980 - Improved i18n framework to support locale aware formatting (dates and numbers) and form processing.
Thanks to Marc Garcia for working on this during his Google Summer of Code 2009!
Additionally fixes #1061, #2203, #3940, #5526, #6449, #6231, #6693, #6783, #9366 and #10891.
This is more a problem of localization than internationalization, but could be fixed easily by adding a WEEK_STARTS_MONDAY switch to the config and to use that in the calendar code (by passing it from the view function to the javascript that draws the calendar).