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

$scope.today is initialized on create and cannot be reset #332

Open
shankari opened this issue May 9, 2020 · 1 comment · May be fixed by #335
Open

$scope.today is initialized on create and cannot be reset #332

shankari opened this issue May 9, 2020 · 1 comment · May be fixed by #335

Comments

@shankari
Copy link

shankari commented May 9, 2020

Consider the following scenario:

  • an app using the datepicker is launched on d1
    • $scope.today is set to d1
  • the app is sent to the background (suspended) but NOT KILLED (either by the user or by the system)
  • the date changes (either in the real world, or using the Date and Time settings for faster testing)
  • the app is resumed from the task list
  • the existing datepicker is loaded into memory
  • $scope.today is still d1

So if the datepicker is opened, then d1 shows the "Today" styling and clicking on the "Today" button goes to d1.

Normally, you would handle this in the app by listening to the resume event and then refreshing the object. But $scope.today is not refreshed as part of openDatePicker and I don't see a way to access it from outside the module to refresh it.

@shankari
Copy link
Author

I am going to work around this in my fork by simply resetting $scope.today in openDatePicker. Please let me know if I should submit a PR.

@itbeyond itbeyond linked a pull request Oct 8, 2021 that will close this issue
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 a pull request may close this issue.

1 participant