mirror of
https://github.com/mue/mue.git
synced 2026-06-11 19:18:57 +02:00
- Make author div not load if quote is empty - photoinformation taking too much of the screen - more transitions and consistent transitions - running prettier across all files Co-authored-by: David Ralph <me@davidcralph.co.uk>
25 lines
423 B
JavaScript
25 lines
423 B
JavaScript
export function 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';
|
|
}
|
|
}
|
|
|
|
export function convertTimezone(date, tz) {
|
|
return new Date(
|
|
(typeof date === 'string' ? new Date(date) : date).toLocaleString('en-US', {
|
|
timeZone: tz,
|
|
}),
|
|
);
|
|
}
|