[Pkg-javascript-commits] [dojo] 10/16: Applying Bryan's patch to fix am/pm overrides. Fixes #12155

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 17:39:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.5.3
in repository dojo.

commit a8b9c143efe45e668d975822fc2b49a49f1deae7
Author: Adam Peller <github at peller.org>
Date:   Fri Feb 25 04:37:43 2011 +0000

    Applying Bryan's patch to fix am/pm overrides.  Fixes #12155
    
    git-svn-id: http://svn.dojotoolkit.org/src/branches/1.5/dojo@23886 560b804f-0ae3-0310-86f3-f6aa0a117693
---
 date/locale.js       | 2 +-
 tests/date/locale.js | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/date/locale.js b/date/locale.js
index 222c1c4..f96df9a 100644
--- a/date/locale.js
+++ b/date/locale.js
@@ -82,7 +82,7 @@ dojo.requireLocalization("dojo.cldr", "gregorian");
 					break;
 				case 'a':
 					var timePeriod = (dateObject.getHours() < 12) ? 'am' : 'pm';
-					s = bundle['dayPeriods-format-wide-' + timePeriod];
+					s = options[timePeriod] || bundle['dayPeriods-format-wide-' + timePeriod];
 					break;
 				case 'h':
 				case 'H':
diff --git a/tests/date/locale.js b/tests/date/locale.js
index a7c0115..3a49987 100644
--- a/tests/date/locale.js
+++ b/tests/date/locale.js
@@ -73,6 +73,8 @@ tests.register("tests.date.locale",
 
 	t.is("12 o'clock AM", dojo.date.locale.format(date, {datePattern:"hh 'o''clock' a", selector:"date", locale: 'en'}));
 
+	t.is("11/08/2006 12:55am", dojo.date.locale.format(date, {datePattern:"dd/MM/yyyy", timePattern:"hh:mma", locale: 'en', am:"am", pm:"pm"}));
+
 	// compare without timezone
 	t.is("\u4e0a\u534812\u65f655\u520612\u79d2", dojo.date.locale.format(date, {formatLength:'full',selector:'time', locale:'zh-cn'}).replace(/^.*(\u4e0a\u5348.*)/,"$1"));
 			}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list