Clear and concise description of the problem
The Lorust library currently does not offer date manipulation or formatting utility functions. This omission makes the library less versatile for users who frequently use date and time in their applications.
Suggested solution
- Create a new
date module under the src directory.
- Implement a selection of the most commonly used date utility functions similar to those available in lodash, such as:
isAfter
isBefore
isSame
toDate
addDays
subDays
- Include comprehensive unit tests for each newly implemented function to cover a range of scenarios.
- Update the README file to reflect the addition of the
date category, providing usage examples if possible.
Code Example:
// src/date/mod.rs
use chrono::{DateTime, Utc};
pub fn is_after(a: DateTime<Utc>, b: DateTime<Utc>) -> bool {
// implementation here
}
pub fn is_before(a: DateTime<Utc>, b: DateTime<Utc>) -> bool {
// implementation here
}
// ... more functions
Alternative
As an alternative, we could initially focus on a smaller set of critical date functions, releasing them as a subset of the full date module. Additional functions could be added over time based on user feedback and needs.
Additional context
The inclusion of a date module would significantly expand Lorust's utility, making it a more comprehensive tool for Rust developers. This feature could encourage the adoption of Lorust for projects that require date manipulation, thus contributing to the library's goal to be a complete utility library for Rust.
Validations
Clear and concise description of the problem
The Lorust library currently does not offer date manipulation or formatting utility functions. This omission makes the library less versatile for users who frequently use date and time in their applications.
Suggested solution
datemodule under thesrcdirectory.isAfterisBeforeisSametoDateaddDayssubDaysdatecategory, providing usage examples if possible.Code Example:
Alternative
As an alternative, we could initially focus on a smaller set of critical date functions, releasing them as a subset of the full
datemodule. Additional functions could be added over time based on user feedback and needs.Additional context
The inclusion of a
datemodule would significantly expand Lorust's utility, making it a more comprehensive tool for Rust developers. This feature could encourage the adoption of Lorust for projects that require date manipulation, thus contributing to the library's goal to be a complete utility library for Rust.Validations