You are here: Foswiki>Tasks Web>Item12812 (21 Mar 2014, GeorgeClark)Edit Attach

Item12812: support for localised month names for date comparison

pencil
Priority: Enhancement
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: I18N, FoswikiTime
Branches:
Reported By: GuilainCabannes
Waiting For:
Last Change By: GeorgeClark

support for localised month names for date comparison

  • Foswiki::Time only recognise english month
  • support for supporting other langage month should be appreciate
  • specialy when JSCalendarContrib offer localisation of date in data form, and then disable all date comparison.

IRC log archive

  • [...] mean cut part without intereset
[...]
13:51:38 - GuilainC : in one search (query type) i've : %SEARCH{" d2n(fields[name='Datededbutdepriodesansmission'].value) > d2n('%DATE%') " 
13:53:51 - GuilainC : and in my dataform i've that : %META:FIELD{name="Datededbutdepriodesansmission" attributes="" title="Date de début de période sans mission" value="4 Avr 2014"}%
13:54:25 - GuilainC : the problem, is the search doesn't work or "today < 4 Avr 2014"
13:54:36 - GuilainC : any help should appreciate :)
14:02:34 - GuilainC : i'm follow a track ! my date are localised in my dataforms
14:02:46 - GuilainC : (french localisation)
[...]
14:25:48 - GuilainC : is it possible in search query to call spreadsheetplugin ? 
14:26:08 - jast : I don't think so
14:27:03 - GuilainC : for doing something like this : %CALC{$SUBSTRING(fields[name='foo'],7,4)}% 
14:27:18 - GuilainC : ok...
14:28:48 - jast : right, the constant part you can treat with %CALC
14:28:52 - GuilainC : my idea, was to transform formfield storage date form this format DD/MM/AAAA to an acceptable format for comparison like AAAA/MM/DD
14:28:58 - jast : the part queried from each topic... nope
14:29:27 - GuilainC : with this kind of piece of code %CALC{$FORMATTIME($TIME($SUBSTRING(14/07/1992,7,4)/$SUBSTRING(14/07/1992,4,2)/$SUBSTRING(14/07/1992,1,2)),$day $mon $year)}%
14:30:27 - GuilainC : I forget date comparison, for the moment, and add a status for my search ;) 
14:30:44 - GuilainC : badly development, but enough efficient :) 
14:39:33 - CDot : GuilainC: do you have a locale defined?
14:40:41 - GuilainC : euh... what does it mean ? in configure ? 
14:41:14 - GuilainC : the question is what in data form, date is in french localisation ? DD/MM/YYYY
14:41:17 - GuilainC : ?
14:41:29 - CDot : actually, i just checked and it won't make any difference. Only English month names are recognised.
14:41:52 - CDot : Foswiki::Time::parseDate assumes "Apr" not "Avr"
14:42:50 - GuilainC : it exactly that, 
14:42:54 - GuilainC : for summary, 
14:43:02 - GuilainC : for my user, i use JSCalendarPlugin
14:43:20 - GuilainC : which define date, in dataform in DD Month YYYY 
14:43:38 - GuilainC : where Month is french one : Fev instead of Feb ; Apr instead of Avr
14:43:45 - GuilainC : knowing that, 
14:43:55 - CDot : ... which is localised to France, yes, I understand. However Foswiki::Tine does *not* parse localised dates, only those in English.
14:44:18 - GuilainC : i conclude that d2n() in search query doesn't undertstand french date, so can't make any comparison
14:44:41 - CDot : that's correct. As I said (twice), only English month names are recognised.
14:44:57 - GuilainC : well, I know why it doesn't work ;) 
14:45:06 - GuilainC : precisely, thank for precision
14:45:13 - CDot : sure. You can use ISO format dates (generally a better idea anyway)
14:45:31 - CDot : 2014-04-04
14:45:50 - GuilainC : for computer is a better idea, but for user, is not ;) 

-- GuilainCabannes - 21 Mar 2014

 

ItemTemplate edit

Summary support for localised month names for date comparison
ReportedBy GuilainCabannes
Codebase 1.1.9, trunk
SVN Range
AppliesTo Engine
Component I18N, FoswikiTime
Priority Enhancement
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r2 - 21 Mar 2014, 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