Merge lp:~openerp-dev/openerp-web/7.0-opw-579979-port-pan into lp:openerp-web/7.0

Proposed by Anand
Status: Rejected
Rejected by: Christophe Matthieu (OpenERP)
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-579979-port-pan
Merge into: lp:openerp-web/7.0
Diff against target: 39 lines (+6/-6)
1 file modified
addons/web/static/lib/datejs/parser.js (+6/-6)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-579979-port-pan
Reviewer Review Type Date Requested Status
Christophe Matthieu (OpenERP) (community) Disapprove
Review via email: mp+144254@code.launchpad.net

Description of the change

Hello,
      Fixed the issue of date/datetime not parsed by parseExact if someone missed to enter trailing 0, like format is %dd/%mm/%yy and if he enters date 4/10/12 then parseExact will fail, and on fialing we have called parse method which parse the date/datetime in mm/dd/yy format, so due to this month and date is interchanged.

attached video for reproduce:-https://docs.google.com/open?id=0B0jT5NnR2uk-aEhIRHRaSENSWHc

To post a comment you must log in.
Revision history for this message
Christophe Matthieu (OpenERP) (chm-openerp) wrote :

Hi,
Don't modify the libs please.
Thanks.

review: Disapprove

Unmerged revisions

3709. By Anand

[FIX][7.0]Fixed the issue of date/datetime not parsed by parseExact if someone missed to enter trailing 0, like format is %dd/%mm/%yy and if he enters date 4/10/12 then parseExact will fail, and on fialing we have called parse method which parse the date/datetime in mm/dd/yy format, so due to this month and date is interchanged.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/lib/datejs/parser.js'
2--- addons/web/static/lib/datejs/parser.js 2011-08-22 14:39:24 +0000
3+++ addons/web/static/lib/datejs/parser.js 2013-01-22 10:05:26 +0000
4@@ -766,13 +766,13 @@
5
6 // hour, minute, second, meridian, timezone
7 g.h = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/), t.hour));
8- g.hh = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/), t.hour));
9+ g.hh = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/), t.hour));
10 g.H = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/), t.hour));
11- g.HH = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/), t.hour));
12+ g.HH = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/), t.hour));
13 g.m = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.minute));
14- g.mm = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.minute));
15+ g.mm = _.cache(_.process(_.rtoken(/^[0-5][0-9]|[0-9]/), t.minute));
16 g.s = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.second));
17- g.ss = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.second));
18+ g.ss = _.cache(_.process(_.rtoken(/^[0-5][0-9]|[0-9]/), t.second));
19 g.hms = _.cache(_.sequence([g.H, g.m, g.s], g.timePartDelimiter));
20
21 // _.min(1, _.set([ g.H, g.m, g.s ], g._t));
22@@ -788,7 +788,7 @@
23 // days, months, years
24 g.d = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),
25 _.optional(g.ctoken2("ordinalSuffix"))), t.day));
26- g.dd = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/),
27+ g.dd = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),
28 _.optional(g.ctoken2("ordinalSuffix"))), t.day));
29 g.ddd = g.dddd = _.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"),
30 function (s) {
31@@ -798,7 +798,7 @@
32 }
33 ));
34 g.M = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/), t.month));
35- g.MM = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/), t.month));
36+ g.MM = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/), t.month));
37 g.MMM = g.MMMM = _.cache(_.process(
38 g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"), t.month));
39 g.y = _.cache(_.process(_.rtoken(/^(\d\d?)/), t.year));