Skip to content

feat: add custom reference date functionality to date picker - #4792

Merged
web-padawan merged 18 commits into
masterfrom
1107-date-picker-parsing-web-component-branch
Oct 27, 2022
Merged

web-padawan merged 18 commits into
masterfrom
1107-date-picker-parsing-web-component-branch

Conversation

@ugur-vaadin

@ugur-vaadin ugur-vaadin commented Oct 21, 2022 •

Copy link
Copy Markdown
Contributor

Description

Add custom reference date functionality. Instead of a fixed reference date of 1950, the default reference date can now be configured with a default value of the current date.

Add relevant tests.

Related to vaadin/flow-components#1107

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/contributing/overview
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.
  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

Add custom reference date functionality. Add relevant tests.
@ugur-vaadin ugur-vaadin changed the title feat: add custom reference date functionality feat: add custom reference date functionality to date picker Oct 21, 2022
Rename calculateDateBasedOnReferenceDate into calculateYearBasedOnReferenceDate. Move the function to date picker helper class.
Move referenceDate into i18n. Change referenceDate object type into DatePickerDate. Add tests for exact year difference of 50. Add clarifying comments. Change variables named "date" into "day". Change the name of the function "calculateYearBasedOnReferenceDate" into "getAdjustedYear". Add tests for out of range parameters for the function "getAdjustedYear".
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@web-padawan
web-padawan removed the request for review from yuriy-fix October 27, 2022 07:42
@web-padawan
web-padawan merged commit b0aadde into master Oct 27, 2022
@web-padawan
web-padawan deleted the 1107-date-picker-parsing-web-component-branch branch October 27, 2022 07:44
@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @ugur-vaadin , this commit cannot be picked to 23.3 by this bot, can you take a look and pick it manually?
Error Message: Error: Command failed: git cherry-pick b0aadde
error: could not apply b0aadde... feat: add i18n.referenceDate to support custom reference date (#4792)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.0.0.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants