1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 16:13:18 +00:00
musix-oss/node_modules/date-and-time/plugin/ordinal.js
2020-03-03 22:30:50 +02:00

39 lines
1.0 KiB
JavaScript

(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));