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

datepicker timezone issue on view layer fixed #1168

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Conversation

barshat7
Copy link
Contributor

@barshat7 barshat7 commented Apr 8, 2024

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

* We only test for 'yyyy-MM-dd' because timezone related issue only occurs when date is selected from calendar.
* And calendar only sets value in yyyy-MM-dd
*/
if (isDateDefaultFormat(value)) {
Copy link
Collaborator

@rismehta rismehta Apr 8, 2024

Choose a reason for hiding this comment

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

Date will always come in this format, why have you added this check ? We don't support any other format in saveValue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a user manually enters some other date format from the input widget

Copy link
Collaborator

@rismehta rismehta Apr 8, 2024

Choose a reason for hiding this comment

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

For saveValue there is no formatting, you don't need this check. Formatting is only for display/edit value

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 91 100 100 73

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 100 100 73

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.75%. Comparing base (64d220a) to head (74bbd69).

Additional details and impacted files
@@            Coverage Diff            @@
##                dev    #1168   +/-   ##
=========================================
  Coverage     80.75%   80.75%           
  Complexity      773      773           
=========================================
  Files            91       91           
  Lines          2110     2110           
  Branches        285      285           
=========================================
  Hits           1704     1704           
  Misses          252      252           
  Partials        154      154           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -1119,10 +1119,6 @@ if (typeof window.DatePickerWidget === 'undefined') {
if (this.#isEditValueOrDisplayValue(this.#widget.value)) {
return this.#model.value; // if the widget has edit/display value thus method should return model value
}
let dateVal = new Date(this.toString());
if (!isNaN(dateVal)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this added earlier?

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 100 100 73

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 92 100 100 73

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@@ -1119,10 +1119,6 @@ if (typeof window.DatePickerWidget === 'undefined') {
if (this.#isEditValueOrDisplayValue(this.#widget.value)) {
return this.#model.value; // if the widget has edit/display value thus method should return model value
}
let dateVal = new Date(this.toString());
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this should be removed

datepicker timezone issue on view layer fixed

datepicker timezone issue on view layer fixed
@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 92 100 100 73

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 100 100 73

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@@ -99,6 +99,12 @@
this.widgetObject.setValue(e.target.value);
this.setActive();
}, this.getWidget());
this.widgetObject.addEventListener('input', (e) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure how is this change related to the current issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This issue is not directly related to timezone issue, but when we fix the timezone, this issue manifests in one of the test case.
Reason being that we were not clearing the value of the input field when user emptied it. (We do that from calendar icon but I think this was missed when manual entry of date was implemented).

@@ -1194,6 +1197,9 @@ if (typeof window.DatePickerWidget === 'undefined') {
case 'focus':
handler(e);
break;
case 'input':
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you need this listener in the current CL? Please fix this as a separate JIRA

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR will not pass if this is not fixed, or will have to comment out a test case

Copy link
Collaborator

@rismehta rismehta left a comment

Choose a reason for hiding this comment

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

check comments

@rismehta rismehta merged commit 6556e4f into dev Apr 11, 2024
11 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 11, 2024
* datepicker timezone issue on view layer fixed

datepicker timezone issue on view layer fixed

datepicker timezone issue on view layer fixed

* datepicker fix test case
github-actions bot pushed a commit that referenced this pull request May 7, 2024
* datepicker timezone issue on view layer fixed

datepicker timezone issue on view layer fixed

datepicker timezone issue on view layer fixed

* datepicker fix test case
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.

None yet

4 participants