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

Merged

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. Editable Input Field by Default:

    • The input field for the calendar is editable by default.
  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)

    • When the strictValidation is set to true, the system will throw an error if the entered date is out of the specified minDate or maxDate range.
    • When the strictValidation is set to false, 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
to avoid double calls to multi-calendar library
@kabaros
Copy link
Collaborator

kabaros commented Jul 25, 2024

this looks good to me - just wanted to have the work in this PR merged as part of it then we can merge and publish it

@alaa-yahia alaa-yahia changed the base branch from master to alpha July 31, 2024 19:02
@dhis2-bot dhis2-bot temporarily deployed to netlify July 31, 2024 19:08 Inactive
@alaa-yahia alaa-yahia requested review from tomzemp and removed request for Mohammer5 July 31, 2024 19:12
@dhis2-bot dhis2-bot temporarily deployed to netlify July 31, 2024 19:48 Inactive
@kabaros kabaros merged commit 99a78f5 into alpha Aug 1, 2024
16 checks passed
@kabaros kabaros deleted the LIBS-440-support-min-and-max-date-and-required-validation branch August 1, 2024 10:02
dhis2-bot added a commit that referenced this pull request Aug 1, 2024
# [9.9.0-alpha.2](v9.9.0-alpha.1...v9.9.0-alpha.2) (2024-08-01)

### Features

* support editable input | min & max dates | dd-mm-yyyy format in CalendarInput ([#1504](#1504)) ([99a78f5](99a78f5))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 9.9.0-alpha.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants