@edouardmisset/date@5.0.0
Utility functions for working with dates
default
Comprehensive date manipulation utilities for parsing, formatting, and date calculations. Includes functions for date conversion, boundary calculations, and date arithmetic. E.g. parseDate, isValidDate, convertStringDate, firstDateOfMonth
Converts a string date from "dd/mm/yyyy hh:mm" format to "yyyy-mm-ddThh:mm" format. If the input string is empty, it returns an empty string. If the input string does not match the expected format, it returns an error.
Date format types supported by the parseDate function. The following formats are supported:
Converts a string or a Date object into a Date object.
Type representing the parameter object for date-in-duration checks.
Returns the first date of the month for a given date.
Checks if the given value is compatible with Date.
Checks if the given date is within the duration from the reference date (inclusive).
Determines if a given date is within the last 12 months from the current date.
Checks if the given date is within the given start and end dates (inclusive).
Checks if the given option is of type StartAndEndDate.
Checks if the provided date string corresponds to a date in the specified year.
Checks if the given dates are valid.
Checks if the given option is of type Year.
Returns the last date of the month for a given date.
Parses a date string in the specified format and returns a Date object.
Sorts objects by their date property.
Converts a Date object into a string in the format 'yyyy-mm-dd'.
Converts a string date from "dd/mm/yyyy hh:mm" format to "yyyy-mm-ddThh:mm" format. If the input string is empty, it returns an empty string. If the input string does not match the expected format, it returns an error.
Converts a string or a Date object into a Date object.
Returns the first date of the month for a given date.
Checks if the given value is compatible with Date.
Type representing the parameter object for date-in-duration checks.
Checks if the given date is within the duration from the reference date (inclusive).
Determines if a given date is within the last 12 months from the current date.
Checks if the given date is within the given start and end dates (inclusive).
Checks if the given option is of type StartAndEndDate.
Checks if the provided date string corresponds to a date in the specified year.
Checks if the given option is of type Year.
Checks if the given dates are valid.
Returns the last date of the month for a given date.
Date format types supported by the parseDate function. The following formats are supported:
Parses a date string in the specified format and returns a Date object.
Sorts objects by their date property.
Converts a Date object into a string in the format 'yyyy-mm-dd'.