Skip to content

Instantly share code, notes, and snippets.

@arup-b
Created January 2, 2019 15:49
Show Gist options
  • Save arup-b/d0fbbd2c3571929d47810847d5fa1f02 to your computer and use it in GitHub Desktop.
Save arup-b/d0fbbd2c3571929d47810847d5fa1f02 to your computer and use it in GitHub Desktop.
var list = [{"endAt":1546327200621,"endTime":770,"location":{"latitude":22.563032,"longitude":88.3148152},"minutes":1,"punchType":2,"reverseGeocode":"392, Sarat Chatterjee Road, Bataitala, Kazipada, Shalimar, Howrah, West Bengal 711103, India","startAt":1546327117421,"startTime":768,"teamRef":"-LQJBi69vfFfvU9Dmz-x","timeStamp":1546327200621,"day":"1 January 2019"},
{"endAt":1546327400397,"endTime":773,"location":{"latitude":22.563032,"longitude":88.3148152},"minutes":3,"punchType":1,"reverseGeocode":"392, Sarat Chatterjee Road, Bataitala, Kazipada, Shalimar, Howrah, West Bengal 711103, India","startAt":1546327200632,"startTime":770,"teamRef":"-LQJBi69vfFfvU9Dmz-x","timeStamp":1546327400397,"day":"1 January 2019"},
{"endAt":1546442735609,"endTime":1255,"location":{"latitude":22.5630316,"longitude":88.3148142},"minutes":6,"punchType":1,"reverseGeocode":"392, Sarat Chatterjee Road, Bataitala, Kazipada, Shalimar, Howrah, West Bengal 711103, India","startAt":1546442344340,"startTime":1249,"teamRef":"-LQJBi69vfFfvU9Dmz-x","timeStamp":1546442735609,"day":"2 January 2019"}];
/*
Notes:
1: punchType signifies which type of time puch user used [ offline = 0, on a Break = 1; online = 2
2: each punch records a timeStamp
3: I need to calculate total offline , online & break time for a day and plot them on a graph or any visual representation
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment