question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

viewDateChange fired before viewDate is updated

See original GitHub issue

changing the order of these yeilds the wrong date

    <div
        class="btn btn-primary"
        mwlCalendarPreviousView
        (viewDateChange)="fetchEvents()"
        [(viewDate)]="viewDate"
        [view]="view"
      >
        Previous
      </div>

Hit next and check console log

https://stackblitz.com/edit/angular-kcqaxw?file=demo%2Fcomponent.ts

Screenshots image

Versions

"angular-calendar": "0.28.1",
"angular-calendar": "0.28.1",

chrome 79

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mattlewis92commented, Feb 29, 2020

This is just how angular works, there’s nothing I can do my end to fix this. Another possible workaround is to do (viewDateChange)="fetchEvents($event)" where $event will contain the new date

0reactions
mjtrjkcommented, Feb 27, 2020

work around … setTimeout(() => console.log('delay', this.viewDate), 10);

you could even change the order to

[(viewDate)]="viewDate"
(viewDateChange)="fetchEvents()"

this is caused by Angular´s banana-in-a-box syntax sugar -> https://angular.io/guide/template-syntax#two-way-binding-

Code formater rearranges order so this is problematic assuming order

You can then de-sugar it yourself.

[viewDate]="viewDate"
(viewDateChange)="viewDate = $event; fetchEvents()"
Read more comments on GitHub >

github_iconTop Results From Across the Web

Listener for "date change" in FullCalendar? - Stack Overflow
Is there any way to attach a listener to FullCalendar that will be fired whenever the currently viewed date is changed, ...
Read more >
@fullcalendar/interaction | Yarn - Package Manager
FullCalendar Interaction Plugin. Calendar functionality for event drag-n-drop, event resizing, date clicking, and date selecting ...
Read more >
PeopleSoft 9.2: Staffing Front Office - Oracle Help Center
Pages Used to Enter Data to Create New Applicant Records. ... Use the Change Dates/View History page (FO_ASGN_CHANGE_DT) to view date change information....
Read more >
angular-calendar - UNPKG
appendToBody\n );\n // keep re-positioning the tooltip until the arrow position ... Called when the view date is changed\n */\n @Output() viewDateChange: ...
Read more >
Source of CHANGELOG.md - scheduler - Bitbucket
fix recurring event expansion when event starts before view and has ... can force the calendar to fetch events on every view/date change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found