Note that the moment object itself is mutable, so different operations change the original moment object. Unlike moment, Luxon objects are immutable so making changes actually means creating a new instance with different properties. At nearly 12K stars day.
This library also helps you parse, validate, manipulate, and display dates and times, and is also immutable and chainable. Instead of modifying the native Date. All API operations that change the Dayjs object in some way will return a new instance of it.
The library has a handful of dependancies, including lodash. The library has no external dependancies.
Sign in Get started. The seconds value is a double type, allowing fractional seconds. Gets or sets the date value for this item in.
Gets or sets the decimal year number i. Calculate a decimal year value e. The default format string to be used in ToString when no format is provided. Tests whether obj is either an XDate structure or a double floating point value that is equal to the same date as this XDate struct instance. Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. Get the calendar date year, month, day corresponding to this instance.
Get the calendar date year, month, day, hour, minute, second corresponding to this instance. Get the day of year value Returns the hash code for this XDate structure. In this case, the hash code is simply the equivalent hash code for the floating point double date value. Gets the Type of the current instance.
Implicit conversion from XDate to DateTime. Implicit conversion from DateTime to XDate. Returns true if this XDate struct is in the valid date range. The maximum valid Julian Day, which corresponds to December 31st, A.
The minimum valid Julian Day, which corresponds to January 1st, B. Gets or sets the date value for this item in Julain day format. This is the Astronomical Julian Day number, so a value of 0. Thus, Julian Day number 2,, Calculate a Calendar date year, month, day, hour, minute, second corresponding to the Astronomical Julian Day number. Take the specified date, and bound it to the valid date range for the XDate struct.
Creates a shallow copy of the current Object. Set the calendar date year, month, day, hour, minute, second of this instance. When two XDates are subtracted, the number of days between dates is returned. When a double value is subtracted from an XDate, the result is a new XDate with the number of days subtracted.
Format this XL Date value using the specified format string. The format string is specified according to the DateTime class. Format the specified XL Date value using the specified format string. Calculate a Calendar date year, month, day, hour, minute, second corresponding to the specified XL date. Calculate a day-of-week value e. Calculate a day-of-year value e.