We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 687ceb3 + 19eeec2 commit eef29f9Copy full SHA for eef29f9
functions/datetime/date.js
@@ -89,9 +89,11 @@ function date (format, timestamp) {
89
N: function () { // ISO-8601 day of week; 1[Mon]..7[Sun]
90
return f.w() || 7;
91
},
92
- S: function () { // Ordinal suffix for day of month; st, nd, rd, th
93
- var j = f.j();
94
- 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;
95
+ if (i <= 3 && parseInt((j%100)/10) == 1) i = 0;
96
+ return ['st', 'nd', 'rd'][i - 1] || 'th';
97
98
w: function () { // Day of week; 0[Sun]..6[Sat]
99
return jsdate.getDay();
0 commit comments