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: support editable input | min & max dates | dd-mm-yyyy format in CalendarInput #1504

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

alaa-yahia
Copy link
Member

@alaa-yahia alaa-yahia commented May 21, 2024

Implements LIBS-440 & DHIS2-17520 & LIBS-418

Supporting pull request

Description

  • Make CalendarInput component editable
  • Support min and max date
  • Support dd-mm-yyyy date format

Below are the key updates:

  1. Non-Editable Input Field by Default:

    • The input field for the calendar is now non-editable by default.
    • To make the input field editable, the user must explicitly set the editable prop to true.
  2. Date Format Handling

    • The date format changes based on the user's input.
    • Subsequent dates will follow the format of the last valid date entered unless a new format is provided by typing a valid date into the input field.
  3. Validation Behaviour (Error/Warning)

    • The validation prop can be set to either error or warning.
    • When the validation is set to error, the system will throw an error if the entered date is out of the specified minDate or maxDate range.
    • When the validation is set to warning, a warning will be issued without throwing an error.
    • This validation does not apply if the date string itself is invalid as it will always throw an error.

To do next

  • Errors should not be displayed when the user enters a partial date in the input field.
  • When minDate and maxDate are specified, dates outside the allowed range should be grayed out in the date picker.

Checklist

  • API docs are generated
  • Tests were added
  • Storybook demos were added

@alaa-yahia alaa-yahia requested a review from a team as a code owner May 21, 2024 08:18
@alaa-yahia alaa-yahia marked this pull request as draft May 21, 2024 08:19
@dhis2-bot
Copy link
Contributor

dhis2-bot commented May 21, 2024

🚀 Deployed on https://pr-1504--dhis2-ui.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify May 21, 2024 08:22 Inactive
Copy link

cypress bot commented May 21, 2024

Passing run #3421 ↗︎

0 584 0 0 Flakiness 0

Details:

fix: lint warnings
Project: ui Commit: d77e2ef530
Status: Passed Duration: 07:46 💡
Started: Jun 10, 2024 10:39 AM Ended: Jun 10, 2024 10:46 AM

Review all test suite changes for PR #1504 ↗︎

@dhis2-bot dhis2-bot temporarily deployed to netlify May 21, 2024 14:51 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify May 29, 2024 09:27 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify June 10, 2024 11:34 Inactive
@alaa-yahia alaa-yahia force-pushed the LIBS-440-support-min-and-max-date-and-required-validation branch from 1db28e1 to dc41b7b Compare June 10, 2024 11:48
@dhis2-bot dhis2-bot temporarily deployed to netlify June 10, 2024 11:54 Inactive
@alaa-yahia alaa-yahia force-pushed the LIBS-440-support-min-and-max-date-and-required-validation branch from dc41b7b to b5546ba Compare June 10, 2024 11:56
@dhis2-bot dhis2-bot temporarily deployed to netlify June 10, 2024 11:59 Inactive
@alaa-yahia alaa-yahia force-pushed the LIBS-440-support-min-and-max-date-and-required-validation branch from b5546ba to cc7f4c7 Compare June 10, 2024 12:01
@dhis2-bot dhis2-bot temporarily deployed to netlify June 10, 2024 12:04 Inactive
@alaa-yahia alaa-yahia force-pushed the LIBS-440-support-min-and-max-date-and-required-validation branch from cc7f4c7 to 35ea873 Compare June 10, 2024 14:32
@dhis2-bot dhis2-bot temporarily deployed to netlify June 10, 2024 14:36 Inactive
@alaa-yahia alaa-yahia force-pushed the LIBS-440-support-min-and-max-date-and-required-validation branch from 35ea873 to 21d37f1 Compare June 10, 2024 14:39
@dhis2-bot dhis2-bot temporarily deployed to netlify June 10, 2024 14:44 Inactive
@alaa-yahia alaa-yahia marked this pull request as ready for review June 10, 2024 14:53
@alaa-yahia alaa-yahia changed the title feat: support min & max dates in CalendarInput feat: support editable input | min & max dates | dd-mm-yyyy format in CalendarInput Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants