You are here: Foswiki>Tasks Web>Item11701 (11 Apr 2012, GeorgeClark)Edit Attach

Item11701: JSCalendarContrib should fallback to numbers for month in case it is given a date like 1/12/2012 and format expects 1 Dec 2012.

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.5
Target Release: patch
Applies To: Engine
Component: JSCalendarContrib
Branches: Release01x01 trunk
Reported By: SvenDowideit
Waiting For:
Last Change By: GeorgeClark
(sorry George, the title is for Olivier)

steps to show issue:

  1. goto http://foswiki.org/System/JSCalendarContrib#Displaying_the_calendar
  2. type '1/12/2012' into the text box
  3. click the calendar button

jscal has selected 12 jan 2012, which is not the same order as much of the world expects, is not the order in the cfg setting (which is day mon year, though with spaces) and more ironically, is different from twiki - where (i was told it was correct - but t.o just ignores the text entirely)

-- SvenDowideit - 29 Mar 2012

It's a feature from Dyncalendar. We're telling it the date format is: %e %B %Y, so it's looking for a number, then a string, then another number, but we're passing it 3 numbers.

An easy fix is to hack the JS guessing the date to fallback to numbers in case %B doesn't match anything. It works, and I don't really like it, but I can't think of anything more clever to do.

Here we were then using the fallback mechanism, which is US-only. Hacking the fallback means some parts of the world won't be happy, so... committing this to trunk, feel free to comment / amend / revert.

-- OlivierRaginel - 29 Mar 2012

It seems my comment wasn't clear. Yes, I fixed it the right way, and it should work for anybody. I was just saying that it was finding the US date because it was using the fallback mechanism, and that if I were to hack the fallback mechanism to do the right thing, then the US people would be unhappy. Thanks for merging, George.

-- OlivierRaginel - 30 Mar 2012
 

ItemTemplate edit

Summary JSCalendarContrib should fallback to numbers for month in case it is given a date like 1/12/2012 and format expects 1 Dec 2012.
ReportedBy SvenDowideit
Codebase 1.1.5 RC1, trunk
SVN Range
AppliesTo Engine
Component JSCalendarContrib
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:774b413993fe distro:995b34d42d78
TargetRelease patch
ReleasedIn 1.1.5
CheckinsOnBranches Release01x01 trunk
trunkCheckins distro:774b413993fe
Release01x01Checkins distro:995b34d42d78
Topic revision: r7 - 11 Apr 2012, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy