UNPKG

moment-timezone-for-local-time

Version:

Get all matching timezones given a local time and a timestamp. Moment.js plugin

39 lines (38 loc) 1.83 kB
import moment from "moment-timezone"; declare module "moment" { interface MomentTimezone { /** * List all timezones with the same local time as current system. * * @returns list of timezone identifiers * @author [moment-timezone-for-local-time](https://github.com/Serrulien/moment-timezone-for-local-time) */ forLocalTime(): string[]; /** * List all timezones with the same local time for a given timestamp. * * @param timestamp defaults to Date.now() * @returns list of timezone identifiers * @throws {RangeError} when hour isn't in [0, 23] or minute isn't in [0, 59] * @author [moment-timezone-for-local-time](https://github.com/Serrulien/moment-timezone-for-local-time) */ forLocalTime(hour: number, minute: number, timestamp?: moment.Moment | Date | number | null): string[]; } } /** * List all timezones with the same local time as current system. * * @returns list of timezone identifiers * @author [moment-timezone-for-local-time](https://github.com/Serrulien/moment-timezone-for-local-time) */ export declare function forLocalTime(this: typeof moment.tz): string[]; /** * List all timezones with the same local time for a given timestamp. * * @param timestamp defaults to Date.now() * @returns list of timezone identifiers * @throws {RangeError} when hour isn't in [0, 23] or minute isn't in [0, 59] * @author [moment-timezone-for-local-time](https://github.com/Serrulien/moment-timezone-for-local-time) */ export declare function forLocalTime(this: typeof moment.tz, hour: number, minute: number, timestamp?: moment.Moment | Date | number | null): string[]; export declare function extend(momentJS: typeof moment): void;