Skip to content

Commit

Permalink
Merge pull request locutusjs#69 from menzoic/patch-1
Browse files Browse the repository at this point in the history
Update functions/datetime/date.js
  • Loading branch information
kvz committed Feb 16, 2013
2 parents 687ceb3 + 19eeec2 commit eef29f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions functions/datetime/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ function date (format, timestamp) {
N: function () { // ISO-8601 day of week; 1[Mon]..7[Sun]
return f.w() || 7;
},
S: function () { // Ordinal suffix for day of month; st, nd, rd, th
var j = f.j();
return j < 4 | j > 20 && (['st', 'nd', 'rd'][j % 10 - 1] || 'th');
S: function(){ // Ordinal suffix for day of month; st, nd, rd, th
var j = f.j()
i = j%10;
if (i <= 3 && parseInt((j%100)/10) == 1) i = 0;
return ['st', 'nd', 'rd'][i - 1] || 'th';
},
w: function () { // Day of week; 0[Sun]..6[Sat]
return jsdate.getDay();
Expand Down

0 comments on commit eef29f9

Please sign in to comment.