Skip to content

refactor: ensure _selectedDate is null when value is empty - #4187

Merged
web-padawan merged 2 commits into
masterfrom
refactor/ensure-selected-date-is-null
Jul 13, 2022
Merged

web-padawan merged 2 commits into
masterfrom
refactor/ensure-selected-date-is-null

Conversation

@vursen

@vursen vursen commented Jul 13, 2022 •

Copy link
Copy Markdown
Contributor

Description

This is a minor refactoring that aims to ensure _selectedDate is null any time value is empty. Previously, _selectedDate could become an empty string in certain cirtumstances which is incorrect given its type Date.

Along the way, I also refactored the minDate and maxDate properties to make them computed which allowed throwing away the crappy generic _handleDateChange method completely.

Addresses #4169 (comment)

Type of change

  • Internal

Checklist

  • I have read the contribution guide: https://vaadin.com/docs-beta/latest/guide/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.

@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

@DiegoCardoso DiegoCardoso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@web-padawan
web-padawan merged commit fae7b90 into master Jul 13, 2022
@web-padawan
web-padawan deleted the refactor/ensure-selected-date-is-null branch July 13, 2022 14:07
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.

3 participants