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

fix(datepicker): Maintain selected date when same date selected (#5209) #5496

Merged
merged 5 commits into from
Jan 11, 2020

Conversation

castriganoj
Copy link
Contributor

@castriganoj castriganoj commented Oct 14, 2019

Use getTime() for JS dateTime compare.

closes #5209

PR Checklist

Before creating new PR, please take a look at checklist below to make sure that you've done everything that needs to be done before we can merge it.

  • read and followed the CONTRIBUTING.md guide.
  • built and tested the changes locally.
  • added/updated tests.
  • added/updated API documentation.
  • added/updated demos.

@castriganoj
Copy link
Contributor Author

This does not exactly solve what the issue requests. Based on what was found in code and what the issue requests this update does solve the requester's issue of maintaining the 'today' string. When the Date value is set in the bs-datepickerDirective component there is a check for the same value. I believe the intention was to check if the same date was selected and return immediately if so. Otherwise continue and propagate the change to the other components with this.bsValueChange.emit(value). It compares 2 date objects which would always return false even if they are the same date.

To summarize, this change may solve a separate but overlapping issue. Custom text inputs would require separate and additional changes. I look forward to your feedback. Please let me know how to proceed.

Thanks much, Jim.

@castriganoj castriganoj marked this pull request as ready for review October 14, 2019 21:22
@daniloff200 daniloff200 requested a review from Domainv October 22, 2019 15:36
@codecov
Copy link

codecov bot commented Oct 28, 2019

Codecov Report

Merging #5496 into development will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           development    #5496   +/-   ##
============================================
  Coverage        52.52%   52.52%           
============================================
  Files                3        3           
  Lines               99       99           
  Branches            17       17           
============================================
  Hits                52       52           
  Misses              37       37           
  Partials            10       10

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3078f07...1f75549. Read the comment docs.

@daniloff200
Copy link
Contributor

I think, it can be useful.

@daniloff200
Copy link
Contributor

hey, @castriganoj
Thanks again for your contribution ! Could you please fill out this form so we can send some swag to you? Thanks!

@daniloff200 daniloff200 merged commit b674b4b into valor-software:development Jan 11, 2020
IraErshova pushed a commit to IraErshova/ngx-bootstrap that referenced this pull request Jan 20, 2020
…r-software#5209) (valor-software#5496)

fix(datepicker): Maintain selected date when same date selected  (valor-software#5209) (valor-software#5496)
Co-authored-by: Vitaliy Makogon <mvitaliyd@gmail.com>
Co-authored-by: Dmitriy Danilov <daniloff200@gmail.com>
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.

DatePicker display 'value' not updated when same date is selected again
3 participants