Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
@Keyframes working { from { booty: on; } to { booty: off; } }

Brandon McConnell brandonmcconnell

💻
@Keyframes working { from { booty: on; } to { booty: off; } }
View GitHub Profile
@brandonmcconnell
brandonmcconnell / getTimeSince.js
Last active Jun 28, 2022
getTimeSince - function for getting a human-readable value of the time since/between datetimes
View getTimeSince.js
const ordinalizeNumber = n => {
const rule = new Intl.PluralRules('en-US', { type: 'ordinal' }).select(n);
const suffix = ({
one: 'st',
two: 'nd',
few: 'rd',
other: 'th',
})[rule];
return `${n}${suffix}`;
}