Opened 18 years ago
Closed 14 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 Changed 18 years ago by
milestone: | → Version 0.92 |
---|---|
Severity: | normal → major |
Type: | enhancement → defect |
comment:2 Changed 18 years ago by
milestone: | Version 0.92 |
---|---|
Severity: | major → normal |
comment:3 Changed 17 years ago by
priority: | normal → lowest |
---|---|
Severity: | normal → minor |
comment:4 Changed 17 years ago by
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 Changed 17 years ago by
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:6 Changed 16 years ago by
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 Changed 16 years ago by
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 Changed 16 years ago by
What about: WEEK_START_DAY = 0-6 ? Monday == 0 ... Sunday == 6 as in datetime?
comment:9 Changed 16 years ago by
It's a matter of convention, so getting the datetime one is as good as any other one.
comment:10 Changed 16 years ago by
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 Changed 16 years ago by
Owner: | changed from nobody to Jannis Leidel |
---|---|
Status: | reopened → new |
Changed 16 years ago by
Attachment: | calendar.diff added |
---|
Implemented WEEK_START_DAY and a little change to the calendar javascript code
comment:12 Changed 16 years ago by
Has patch: | set |
---|
comment:13 Changed 16 years ago by
I have applied the patch but it does not work for me, it simply makes calendar not appear anymore :(
Changed 16 years ago by
Attachment: | calendar2.diff added |
---|
Refactored patch for use with DateField, DateTimeField and TimeField, please patch a fresh checkout
comment:17 Changed 16 years ago by
Keywords: | sprintdec01 added |
---|
comment:18 Changed 15 years ago by
Component: | Admin interface → Internationalization |
---|---|
Keywords: | i18n admin added; sprintdec01 removed |
milestone: | → 1.0 beta |
Owner: | changed from Jannis Leidel to Marc Garcia |
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 Changed 15 years ago by
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 Changed 15 years ago by
Keywords: | i18n-rf added |
---|
Changed 15 years ago by
Fix and example of how djangojs.po files should be updated to work on every language
comment:22 Changed 15 years ago by
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 Changed 15 years ago by
milestone: | → post-1.0 |
---|
comment:26 Changed 15 years ago by
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 Changed 14 years ago by
Keywords: | i18n-fixed added; i18n admin i18n-rf removed |
---|---|
Triage Stage: | Ready for checkin → Accepted |
Fixed in branches/soc2009/i18n-improvements.
comment:29 Changed 14 years ago by
Triage Stage: | Accepted → Fixed on a branch |
---|
comment:30 Changed 14 years ago by
Owner: | changed from Marc Garcia to Jannis Leidel |
---|
comment:31 Changed 14 years ago by
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).