mirror of
https://github.com/mue/mue.git
synced 2026-07-10 14:04:32 +02:00
fix: many bug fixes and some performance improvements
Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
18
src/modules/helpers/date.js
Normal file
18
src/modules/helpers/date.js
Normal file
@@ -0,0 +1,18 @@
|
||||
export default class Date {
|
||||
static nth(d) {
|
||||
if (d > 3 && d < 21) {
|
||||
return d + 'th';
|
||||
}
|
||||
|
||||
switch (d % 10) {
|
||||
case 1:
|
||||
return d + 'st';
|
||||
case 2:
|
||||
return d + 'nd';
|
||||
case 3:
|
||||
return d + 'rd';
|
||||
default:
|
||||
return d + 'th';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user