Permalink
Browse files

Merging pull 26

  • Loading branch information...
1 parent a3c0651 commit 8ca5f944297eda313deb49a5514b5cda6411b71c @phstc committed Mar 10, 2012
Showing with 10 additions and 3 deletions.
  1. +3 −2 README.rdoc
  2. +6 −0 Test.html
  3. +1 −1 jquery.dateFormat-1.0.js
View
@@ -18,7 +18,8 @@ http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html
* yyyy = long year
* yy = short year
-* MM = month
+* M = month (1-12)
+* MM = month (01-12)
* MMM = month abbreviation (Jan, Feb ... Dec)
* MMMM = long month (January, February ... December)
* ddd = day of the week in words (Monday, Tuesday ... Sunday)
@@ -88,4 +89,4 @@ GPL
=== Contributors
-Thanks to albertjan, christopherstott, cipa, dahdread, docchang, eemeyer, gwilson2151, jafin, jakemonO, jharting, kitto, larryzhao, leesolutions, nashg842, fuzzygroove, stuttufu, thiloplanz.
+Thanks to albertjan, christopherstott, cipa, dahdread, docchang, eemeyer, gwilson2151, jafin, jakemonO, jharting, kitto, larryzhao, leesolutions, nashg842, fuzzygroove, stuttufu, thiloplanz, Zyber17.
View
@@ -220,6 +220,12 @@
assertEqual("02", $.format.date(testDate.getTime(), 'mm'));
assertEqual("03", $.format.date(testDate.getTime(), 'ss'));
}},
+ testeShortMonthNoPrependedZero: function() { with(this) {
+ var testDate = new Date("Jan 2, 2000 01:02:03");
+ assertEqual('2', $.format.date('Wed Feb 09 06:23:38 PST 2012', 'M'));
+ assertEqual("1", $.format.date(testDate.getTime(), 'M'));
+ assertEqual('5', $.format.date('2012-05-07CET00:00:00', 'M'));
+ }},
});
// ]]>
</script>
View
@@ -208,7 +208,7 @@
if (format.charAt(i + 1) == "M") {
break;
}
- retValue += month;
+ retValue += parseInt(month, 10);
pattern = "";
break;
case "yyyy":

0 comments on commit 8ca5f94

Please sign in to comment.