Skip to content

[FEAT]: Add the date category from lodash into this package #18

Description

@ImBIOS

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

  1. Create a new date module under the src directory.
  2. 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
  3. Include comprehensive unit tests for each newly implemented function to cover a range of scenarios.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions