Django

Code

Ticket #1061 (new)

Opened 2 years ago

Last modified 5 months ago

Start week day on calendar

Reported by: antoni.aloy@gmail.com Assigned to: jezdez
Component: Admin interface Version: SVN
Keywords: sprintdec01 Cc:
Triage Stage: Accepted Has patch: 1
Needs documentation: 0 Needs tests: 0
Patch needs improvement: 0

Description (Last modified by gwilson)

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

calendar.diff (4.2 kB) - added by jezdez on 11/30/07 22:48:42.
Implemented WEEK_START_DAY and a little change to the calendar javascript code
calendar2.diff (5.0 kB) - added by jezdez on 12/01/07 08:24:22.
Refactored patch for use with DateField?, DateTimeField? and TimeField?, please patch a fresh checkout

Change History

01/03/06 18:13:37 changed by anonymous

  • type changed from enhancement to defect.
  • severity changed from normal to major.
  • milestone set to Version 0.92.

01/04/06 01:39:04 changed by hugo

  • severity changed from major to normal.
  • milestone deleted.

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).

04/23/06 17:53:59 changed by adrian

  • priority changed from normal to lowest.
  • severity changed from normal to minor.

06/02/06 06:23:17 changed by asmodai@in-nomine.org

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.

01/20/07 16:23:14 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Unreviewed to Design decision needed.

08/25/07 19:49:27 changed by f

  • status changed from new to closed.
  • needs_better_patch set to 1.
  • component changed from Admin interface to HTTP handling.
  • keywords set to SUNDAY.
  • needs_docs set to 1.
  • resolution set to fixed.
  • stage changed from Design decision needed to Accepted.

08/25/07 20:09:04 changed by gwilson

  • status changed from closed to reopened.
  • description changed.
  • needs_better_patch deleted.
  • component changed from HTTP handling to Admin interface.
  • keywords deleted.
  • needs_docs deleted.
  • resolution deleted.

reverting spam.

09/14/07 17:12:11 changed by toke

What about: WEEK_START_DAY = 0-6 ? Monday == 0 ... Sunday == 6 as in datetime?

09/14/07 18:14:26 changed by antoni.aloy@gmail.com

It's a matter of convention, so getting the datetime one is as good as any other one.

10/01/07 14:11:42 changed by anonymous

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

11/30/07 18:10:44 changed by jezdez

  • owner changed from nobody to jezdez.
  • status changed from reopened to new.

11/30/07 22:48:42 changed by jezdez

  • attachment calendar.diff added.

Implemented WEEK_START_DAY and a little change to the calendar javascript code

12/01/07 05:28:01 changed by jezdez

  • has_patch set to 1.

12/01/07 06:23:10 changed by aaloy

I have applied the patch but it does not work for me, it simply makes calendar not appear anymore :(

12/01/07 06:43:19 changed by jezdez

Hm, sorry to hear that, did you restart your django process?

12/01/07 07:29:35 changed by aaloy

The patch works for DateTimeFields? but no for DateFields?.

12/01/07 08:24:22 changed by jezdez

  • attachment calendar2.diff added.

Refactored patch for use with DateField?, DateTimeField? and TimeField?, please patch a fresh checkout

12/01/07 08:37:40 changed by aaloy

Tested! It works on both DateField and DateTimeField

12/01/07 10:53:02 changed by jezdez

  • keywords set to sprintdec01.

Add/Change #1061 (Start week day on calendar)




Change Properties
Action