Is your feature request related to a problem? Please describe.
I'd like to enhance the startOf/endOf function in Luxon by adding two new options: millennium, century and decade. Currently, the startOf/endOf function allows for precise date and time manipulation, but it lacks options for larger date units, which can be frustrating when working with historical data and need to set the date to the beginning of a specific millennium or century.
Describe the solution you'd like
I propose adding two new options to the startOf method in Luxon:
millennium: This option should set the date to the start of the current millennium (e.g., for January 1, 1989, it will set the date to January 1, 1000).
century: This option should set the date to the start of the current century (e.g., for January 1, 1989, it will set the date to January 1, 1900).
decade: This option should set the date to the start of the current decade (e.g., for January 1, 1989, it will set the date to January 1, 1980).
Based on the previous explanation, rules for endOf method are trivial.
These options would provide users with a convenient way to manipulate date and time data on a larger scale.
Describe alternatives you've considered
An alternative solution would be to manually calculate the start of the desired millennium, century or decade and set the date and time accordingly. However, this can be cumbersome and error-prone, especially when dealing with different time zones and calendar systems.
Additional context
Adding these options would make Luxon even more versatile for handling historical and large-scale date and time data. It can be particularly useful in scenarios where precise historical accuracy is required or when working with data that spans over multiple centuries.
Is your feature request related to a problem? Please describe. I'd like to enhance the
startOf/endOf
function in Luxon by adding two new options:millennium
,century
anddecade
. Currently, thestartOf/endOf
function allows for precise date and time manipulation, but it lacks options for larger date units, which can be frustrating when working with historical data and need to set the date to the beginning of a specific millennium or century.Describe the solution you'd like I propose adding two new options to the
startOf
method in Luxon:Based on the previous explanation, rules for
endOf
method are trivial.These options would provide users with a convenient way to manipulate date and time data on a larger scale.
Describe alternatives you've considered An alternative solution would be to manually calculate the start of the desired millennium, century or decade and set the date and time accordingly. However, this can be cumbersome and error-prone, especially when dealing with different time zones and calendar systems.
Additional context
Adding these options would make Luxon even more versatile for handling historical and large-scale date and time data. It can be particularly useful in scenarios where precise historical accuracy is required or when working with data that spans over multiple centuries.