Time update in app once device time in changed

I’m building an application where I need to display a calendar. But when I change my device date and time and return back to the app it is crashing. Do I have to run any background services to remove this kind of crashing? I’m using CLNDR.js and moment.js for displaying the calendar and managing the time format.