1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00

Fixed #385 - Thermosat Summary sync progress gets stuck if less than one day of history

This commit is contained in:
Jon Ziebell 2023-01-26 19:38:00 -05:00
parent 747430a4dc
commit b7535a2959

View File

@ -25,8 +25,8 @@ beestat.thermostat.get_sync_progress = function(thermostat_id) {
return null;
}
var denominator = required_sync_end.diff(required_sync_begin, 'day');
var numerator = current_sync_end.diff(current_sync_begin, 'day');
var denominator = required_sync_end.diff(required_sync_begin, 'minute');
var numerator = current_sync_end.diff(current_sync_begin, 'minute');
return Math.min(100, Math.round(numerator / denominator * 100)) || 0;
};