*** Backup Mirror *** The web interface and JSON api for the ConnectedHumber Air Quality Monitoring Project. https://github.com/ConnectedHumber/Air-Quality-Web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Air-Quality-Web/client_src/js/Helpers/DateHelper.mjs

13 lines
361 B

"use strict";
function human_duration_unit(milliseconds) {
let seconds = Math.floor(milliseconds / 1000);
if(seconds <= 60) return "second";
if(seconds <= 60*60) return "minute";
if(seconds <= 60*60*24) return "hour";
if(seconds <= 60*60*24*45) return "day";
if(seconds <= 60*60*24*365) return "month";
return "year";
}
export { human_duration_unit };