Closed kxyoke closed 4 years ago
Rough solutions: get difference in seconds, assume each day has __ seconds (no leap seconds etc) ref: https://stackoverflow.com/questions/542938/how-do-i-get-the-number-of-days-between-two-dates-in-javascript https://www.geeksforgeeks.org/how-to-calculate-the-number-of-days-between-two-dates-in-javascript/
Supposing A is the first day of FDS Calendar (eg. 1/1/20 is FDS M1W1D1)
Since we store timestamp B in database, we want to compute FDS Day d. b = Days between A and B.
FDS W' = b / 7. FDS M = W' / 4.
FDS W = W' % 4. FDS D = ...sim.
Given: FDS 1W = 7D, 1M = 4W Goal: Stats computation + Delivery rider scheduling must be in FDS