Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
ImBIOS opened this issue Sep 7, 2023 · 0 comments
Open
3 tasks done

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

ImBIOS opened this issue Sep 7, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest

Comments

@ImBIOS
Copy link
Owner

ImBIOS commented Sep 7, 2023

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

@ImBIOS ImBIOS added enhancement New feature or request good first issue Good for newcomers labels Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant