Coder Social home page Coder Social logo

due_date's Introduction

Greetings!

🌍👋 Olá! Welcome! Bonjour! Ciao! ¡Hola! I'm FMorschel, a Brazilian developer with a captivating multilingual mission! ✨

🗣️ Embracing the beauty of diverse languages, I aim to foster deeper connections among fellow developers. As I delve into the captivating realms of French, Italian, and Spanish, I make linguistic barriers feel less daunting, creating an inclusive and accessible environment for all. Let's build bridges of understanding and collaboration! 🌟💬

Fun Facts

  • 🧩 I can solve a Rubik's Cube!
  • 🌍 Travel enthusiast: I have a goal of traveling to every continent, exploring diverse cultures and meeting fascinating people.
  • ♟ Chess lover: Chess is my favorite strategic game, and I enjoy playing it in my leisure time.
  • 📚 Bookworm: Reading books is my ultimate passion, and I cherish my collection of thought-provoking novels and non-fiction works.

Background and Experience

Commitment to Diversity and Inclusivity

I am deeply committed to fostering a diverse and inclusive environment in my work and collaborations. I value diverse perspectives and believe in equal opportunities for all. Join me in creating a welcoming and respectful space where everyone can thrive.

Let's collaborate and make a positive impact together! 🌟💻

Check Out My Projects

Curious to see my Dart/Flutter projects? Let's take a peek! 🚀 I have developed two noteworthy projects: due_date and floating_overlay. They are designed to streamline your development process and add visual flair to your app. By exploring these projects, you'll discover valuable solutions and creative ideas for your own endeavors. Dive into the code, documentation, and sample apps, and feel free to ask questions or suggest improvements. Let's create amazing Dart/Flutter experiences together! 👀

due_date's People

Contributors

fmorschel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

due_date's Issues

Creation of `DateValidatorDueWorkdayMonth`

Overview

The proposal is to introduce a new class, DateValidatorDueWorkdayMonth, to enhance the capabilities of the package. This class is designed to calculate if a DateTime is, for example, the fourth workday of the month, or the 7th, etc.

Related to: #17

Proposed Class

DateValidatorDueWorkdayMonth
Purpose: This class is designed to calculate if a DateTime is, for example, the fourth workday of the month, or the 7th, etc..
Parameters:

  • final int dueWorkday - The workday of the month this instance will look for, inside the month.
  • final bool exact - If this class should always look for this exact number or consider it valid if dueWorkday is bigger than the last workday of the analysed month and consider the last workday as valid.
    Usage Example:
const secondWorkday = DateValidatorDueWorkdayMonth(2);
secondWorkday.valid(DateTime(2024, DateTime.january, 2)); // valid because in 2024, the first day of January is a Monday.
secondWorkday.valid(DateTime(2024, DateTime.June, 4)) // valid because in 2024, June 1st and June 2nd are Saturday and Sunday.

Benefits

Increased Functionality: The addition of DateValidatorDueWorkdayMonth will enhance the package's functionality, catering to specific use cases.

Improved Code Organization: This new class contributes to better code organization by encapsulating the validation of specific workdays within a month.

Usability Enhancement: Users can benefit from DateValidatorDueWorkdayMonth by being able to verify if some DateTime is a certain workday inside the month.

Additional Information

Dependencies: It would extend DateValidator, mixin EquatableMixin, DateValidatorMixin and implement Comparable<DateValidatorDueWorkdayMonth>.
Testing: It would be needed to test this class similarly to DateValidatorDueDayMonth.


Your feedback on this proposal is highly encouraged. I will proceed with the implementation and submit a pull request.

Creation of `EveryDueWorkdayMonth`

Overview

The proposal is to introduce a new class, EveryDueWorkdayMonth, to enhance the capabilities of the package. This class is designed to generate a DateTime that is, for example, the fourth workday of the month, or the 7th, etc.

Related to: #17 and #18

Proposed Class

EveryDueWorkdayMonth
Purpose: This class is designed to generate a DateTime that is, for example, the fourth workday of the month, or the 7th, etc.
Parameters:

  • final int dueWorkday - The workday of the month this instance will generate for, inside the month.
    Usage Example:
const secondWorkday = EveryDueWorkdayMonth(2);
secondWorkday.startDate(DateTime(2024)); // would generate `DateTime(2024, 1, 2)`
secondWorkday.startDate(DateTime(2024, 5, 3)) // would generate `DateTime(2024, 6, 4)`

Benefits

Increased Functionality: The addition of EveryDueWorkdayMonth will enhance the package's functionality, catering to specific use cases.

Improved Code Organization: This new class contributes to better code organization by encapsulating the generation of specific workdays within a month.

Usability Enhancement: Users can benefit from EveryDueWorkdayMonth by being able to generate some DateTime that is a certain workday inside the month.

Additional Information

Dependencies: It would extend DateValidatorDueWorkdayMonth, mixin EveryMonth and implement EveryYear and EveryDateValidator.
Testing: It would be needed to test this class similarly to EveryDueDayMonth.


Your feedback on this proposal is highly encouraged. I will proceed with the implementation and submit a pull request.

Calculation of workdays in month

Is your feature request related to a problem? Please describe.
Some events happen, for example, on the second workday of the month, and there are no helpers in this package to deal with that.

Describe the solution you'd like
Create classes that validate and generate new dates based on the number of workdays inside the same month that came before it.
Workdays being considered here are Monday, Tuesday, Wednesday, Thursday and Friday, going towards future generations of DateTimes.

Describe alternatives you've considered
I tried to use some of the existing classes to wrap around this logic but they are complicated enough for them to be considered making part of the package.


  • Search for Existing Issues: I have searched for existing issues related to this functionality.

DateValidator on Override and Skip

Override (#3) and Skip (#2) implement DateValidator and mix DateValidatorMixin. I was thinking about both and I'm not sure if they should. And since they haven't been introduced to the package in pub.dev I'm considering removing this mixin and implementations.

That would also prevent them from being used on all Intersection/Union/Difference lists and that's not something I was looking for.

The reason I'm considering this is that both could consider valid, actually invalid dates by false positives. For example, when skipping, the user can't possibly tell the DateValidator where to start skipping, so all possible dates from the inner Every would be "valid". And when overriding the DateValidator has no Idea where the validation occurred, so if the validation happened on the next method, it would still consider valid both days before and after the Every date generator (considering the created classes until 2022/11/16).

Create an easy way to skip results when calling `next`/`previous`

There should be an easy way to skip/ignore dates that match some validation or a number of iterations.

E.g.:

  • An every that returns Fridays, could have a skip parameter so that it would skip the last Friday of every month.
  • An every that returns the day of the month with the number 15 could have a skip parameter where it would actually return the date after 6 months, being a semester event.

`Override` every wrapper

This proposal is about an Override every wrapper that takes an EveryDateDalidator, a bool Function(DateTime date) when and a DateTime Function(DateTime previous, DateTime invalid) replace.
It would replace the generated date with the result of replace(givenDate, invalidDate).

There should be an override, that would return if the results are a workday/weekend, but if they are not, the next/previous workday/weekend would be returned.

E.g.:

  const every = EveryDueDayMonth(14);
  const workday = Override.workday(every);
  final date = DateTime(2022, DateTime.november, 04);
  DueDateTime dueDate = DueDateTime.fromDate(date, workday);
  print(dueDate); // 2022-11-15
  dueDate = dueDate.next;
  print(dueDate); // 2022-12-14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.