1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-24 01:43:18 +00:00
musix-oss/node_modules/date-and-time/plugin/ordinal.js

39 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-03-03 20:30:50 +00:00
(function (global) {
'use strict';
var exec = function (date) {
date.plugin('ordinal', {
formatter: {
DDD: function (d) {
var day = d.getDate();
switch (day) {
case 1:
case 21:
case 31:
return day + 'st';
case 2:
case 22:
return day + 'nd';
case 3:
case 23:
return day + 'rd';
default:
return day + 'th';
}
}
}
});
};
if (typeof module === 'object' && typeof module.exports === 'object') {
(module.paths || []).push('./');
exec(require('date-and-time'));
} else if (typeof define === 'function' && define.amd) {
define(['date-and-time'], exec);
} else {
exec(global.date);
}
}(this));