I am using javascript to Put the timer on my Webpage. When start button is pressed, clock starts with timestamp.
All the thing are working properly without any error.
code is
initialize_timer: function() {
this.project_m2o = new project_timesheet.FieldMany2One(this, {model: this.project_timesheet_model , classname: "pt_input_project pt_required", label: "Select a project", id_for_input: "project_id"});
this.project_m2o.on("change:value", this, function() {
var project = [this.project_m2o.get('value'), this.project_m2o.$input.val()];
this.project_timesheet_db.set_current_timer_activity({project_id: project});
this.set_project_model();
Now whenever page gest refreshed the clock should be continue, but it is initializing again with 00:00
.
guide me to deal with it!
Store the system time when you start your timer in a cookie or in local storage. Each time your web page loads, you can read the previous system start time and initialize the clock appropriately.
If the time needs to be less prone to tampering, then you would need to store the time on your server for each user and put the start time for that user in the page each time it is served from the server.