Opened 14 years ago

Closed 14 years ago

#6915 closed defect (fixed) failed when patterns begins qith literals

Reported by: guest Owned by: Adam Peller
Priority: high Milestone: 1.2
Component: Date Version: 1.1.0
Keywords: Cc:
Blocked By: Blocking:



We noticed that when using a pattern which begin with literal the function failed.

For example the following code works, because of the leading space : Date(), {selector:"date", datePattern:" 'Week' w, MMMM, yy"});

and the following code failed : Date(), {selector:"date", datePattern:"'Week' w, MMMM, yy"});

To avoid this, just correct the _processPattern() method :

replace the 'literal' variable initialization from :

var literal = false

to :

var literal = pattern.match(/^'/g) != null;

which test if the pattern begins or not with a literal.

thank you !

Matthieu et Damien.

Change History (2)

comment:1 Changed 14 years ago by Adam Peller

Milestone: 1.2

comment:2 Changed 14 years ago by Adam Peller

Resolution: fixed
Status: newclosed

fixed by [13980]: Handle patterns which start with a literal at char 0. Fixes #6915 Merci, Matthieu et Damien!

Note: See TracTickets for help on using tickets.