Skip to content

Conversation

@awcodify
Copy link
Owner

What's this PR do ?

Create smart change freature

This feature is useful for automatically assign date to max posibility if inputted changes is not correct. For instance:

  • we are on leap year
  • today is 31 March 2019
  • we change today.change(month: 2)
  • in native Date module, it will raise error

With this feature we can do:

Dalt.smart_change('31 March 2019', month: 2)

and the result will automatically go to end of 2nd month

=> 28 February 2019

or with alternet, the result will return alternate:

Dalt.smart_change('31 March 2019', month: 2, alt: 'Invalid date')

and the result will automatically go to end of 2nd month

=> "Invalid date"

Where should the reviewer start ?

lib/dalt/formatter.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants