Add timed-mute functionality
This commit is contained in:
parent
95c15fca22
commit
228a9afdf5
7 changed files with 72 additions and 18 deletions
|
|
@ -41,3 +41,19 @@ export const relativeTimeShort = (date, nowThreshold = 1) => {
|
|||
r.key += '_short'
|
||||
return r
|
||||
}
|
||||
|
||||
export const unitToSeconds = (unit, amount) => {
|
||||
switch (unit) {
|
||||
case 'minutes': return 0.001 * amount * MINUTE
|
||||
case 'hours': return 0.001 * amount * HOUR
|
||||
case 'days': return 0.001 * amount * DAY
|
||||
}
|
||||
}
|
||||
|
||||
export const secondsToUnit = (unit, amount) => {
|
||||
switch (unit) {
|
||||
case 'minutes': return (1000 * amount) / MINUTE
|
||||
case 'hours': return (1000 * amount) / HOUR
|
||||
case 'days': return (1000 * amount) / DAY
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue