nhb-toolbox
Version:
A versatile collection of smart, efficient, and reusable utility functions and classes for everyday development needs.
41 lines • 1.51 kB
TypeScript
import type { ChronosStatics } from './types';
/**
* @remarks
* Static methods from the `Chronos` class are copied over to the `chronos` function.
* Therefore, you can access static methods from `Chronos` both through the `Chronos` class and the `chronos` function.
*
* **Note**: *If a date is provided **without a time component**, the instance will default to `00:00:00.000` UTC
* and convert it to the **equivalent local time** using the current environment's UTC offset.*
*
* Example usage:
* ```ts
* chronos.parse("2023-12-31", "YYYY-MM-DD");
* // Or
* Chronos.parse("2023-12-31", "YYYY-MM-DD");
* ```
*
* *No need to call `chronos` for accessing the static methods. Simply call the static methods.*
*
* **Available Static Methods:**
*
* ```ts
* today(options?: FormatOptions): string
* yesterday(): Chronos;
* tomorrow(): Chronos
* now(): number
* use(plugin: ChronosPlugin): void
* parse(dateStr: string, format: string): Chronos
* utc(dateLike: ChronosInput): Chronos
* min(...dates: ChronosInput[]): Chronos
* max(...dates: ChronosInput[]): Chronos
* isLeapYear(date: ChronosInput): boolean
* isValidDate(value: unknown): boolean
* isDateString(value: unknown): boolean
* isValidChronos(value: unknown): boolean
* formatTimePart(time: string, format?: TimeParts): string
* getDatesForDay(day: WeekDay, options?: WeekdayOptions): string[]
* ```
*/
declare const typedChronos: ChronosStatics;
export { typedChronos as chronos };
//# sourceMappingURL=chronos-fn.d.ts.map