Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Dynamically update calendar dates #169

Closed
audsKu opened this issue Sep 3, 2015 · 2 comments
Closed

Dynamically update calendar dates #169

audsKu opened this issue Sep 3, 2015 · 2 comments

Comments

@audsKu
Copy link

audsKu commented Sep 3, 2015

The Timeago directive dynamically updates the relative timestamps if seconds or minutes have elapsed.

But the amCalendar filter does not update if a day has elapsed. For example, if the amCalendar output "Today at 10:33am", one day later, the same output should be updated to "Yesterday at 10:33am".

@urish
Copy link
Owner

urish commented Sep 3, 2015

In Anuglar 1.x, filters can't automatically update their output. That's why I initially created amTimeAgo as a directive and not as a filter.

However, you can probably fix this by manually invoking a digest cycle every minute or so, add the following line to your applciation code:

$interval(angular.identity, 60 * 1000);

@urish urish closed this as completed Sep 3, 2015
@audsKu
Copy link
Author

audsKu commented Sep 9, 2015

Okay thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants