mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-30 04:59:32 +00:00
Applies suggestions from prettier, floor instead of ceil
This commit is contained in:
parent
4ed3235590
commit
246dc663c4
@ -296,11 +296,11 @@ Module.register("weatherforecast", {
|
|||||||
|
|
||||||
let numberOfDays;
|
let numberOfDays;
|
||||||
if (this.config.forecastEndpoint === "forecast") {
|
if (this.config.forecastEndpoint === "forecast") {
|
||||||
numberOfDays = (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 5 : this.config.maxNumberOfDays);
|
numberOfDays = this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 5 ? 5 : this.config.maxNumberOfDays;
|
||||||
// don't get forecasts for the 6th day, as it would not represent the whole day
|
// don't get forecasts for the 6th day, as it would not represent the whole day
|
||||||
numberOfDays = numberOfDays * 8 - Math.ceil(new Date().getHours() / 3) % 8;
|
numberOfDays = numberOfDays * 8 - (Math.floor(new Date().getHours() / 3) % 8);
|
||||||
} else {
|
} else {
|
||||||
numberOfDays = (this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17) ? 7 : this.config.maxNumberOfDays;
|
numberOfDays = this.config.maxNumberOfDays < 1 || this.config.maxNumberOfDays > 17 ? 7 : this.config.maxNumberOfDays;
|
||||||
}
|
}
|
||||||
params += "&cnt=" + numberOfDays;
|
params += "&cnt=" + numberOfDays;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user