Permalink
Browse files

Merge pull request #9 from robcolburn/master

strftime() offers lowercase am/pm via %P
  • Loading branch information...
2 parents f3006f4 + ca6ca41 commit e4a2a3d32a087d915973c5f4f9df49d4d9143329 @samsonjs samsonjs committed May 21, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/index.js
View
@@ -39,6 +39,8 @@
, shortMonths: words('Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec')
, AM: 'AM'
, PM: 'PM'
+ , am: 'am'
+ , pm: 'pm'
}
function strftime(fmt, d, locale) {
@@ -92,6 +94,7 @@
case 'm': return pad(d.getMonth() + 1);
case 'n': return '\n';
case 'p': return d.getHours() < 12 ? locale.AM : locale.PM;
+ case 'P': return d.getHours() < 12 ? locale.am : locale.pm;
case 'R': return _strftime(locale.formats.R || '%H:%M', d, locale);
case 'r': return _strftime(locale.formats.r || '%I:%M:%S %p', d, locale);
case 'S': return pad(d.getSeconds());

0 comments on commit e4a2a3d

Please sign in to comment.