signal-desktop/ts/util/getMuteOptions.ts

33 lines
740 B
TypeScript
Raw Normal View History

2020-10-30 20:34:04 +00:00
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2020-08-27 19:45:08 +00:00
import moment from 'moment';
import { LocalizerType } from '../types/Util';
type MuteOption = {
name: string;
disabled?: boolean;
value: number;
};
export function getMuteOptions(i18n: LocalizerType): Array<MuteOption> {
return [
{
name: i18n('muteHour'),
value: moment.duration(1, 'hour').as('milliseconds'),
},
{
name: i18n('muteDay'),
value: moment.duration(1, 'day').as('milliseconds'),
},
{
name: i18n('muteWeek'),
value: moment.duration(1, 'week').as('milliseconds'),
},
{
name: i18n('muteYear'),
value: moment.duration(1, 'year').as('milliseconds'),
},
];
}