cubism.js - Matching date in Millis in Javascript -


i trying fetch data db every 10 mins data inserted timestamp. using timestamp want visualize field. visualization has step size of 10 mins. checks start till stop time find match. here code -

while((i += step) < stop) {     var key = (new date(i)).gettime();     var value = key in lookup ? lookup[key].gtse: null;     values.push(value); } callback(null, values); 

my problem timestamp fetched db never matches. here data make clear.

the key values -      1st iteration - 1372168200000      2nd iteration - 1372168800000  database fetched value - 1372786393088 

so in case key never matches when iterating on lookup. if dont use step , change while loop while((i += 1) < stop) browser hangs since there lot of processing after this.

should manipulate date before db insertion , change trailing 5-6 places 0 or should handle on client side?

i need advice how tackle this.


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -