Commit 307ae8b0 authored by Jan Wagemakers's avatar Jan Wagemakers

day month/week

parent c46976f9
......@@ -64,10 +64,10 @@ public class StartupRunner implements CommandLineRunner {
Calendar rightNow = Calendar.getInstance();
int year=rightNow.get(Calendar.YEAR)-2000;
int month=rightNow.get(Calendar.MONTH) + 1;
int dayMonth=rightNow.get(Calendar.DAY_OF_MONTH);
int hour = rightNow.get(Calendar.HOUR_OF_DAY);
int min = rightNow.get(Calendar.MINUTE);
int day = rightNow.get(Calendar.DAY_OF_WEEK);
int dayWeek = rightNow.get(Calendar.DAY_OF_WEEK);
int hm = 100 * hour + min;
float lowestTemperature = -1f;
......@@ -87,7 +87,7 @@ public class StartupRunner implements CommandLineRunner {
// 0 = elke dag
// 1 ... 7 = zondag ... zaterdag
if (day == rday || rday == 0) {
if (dayWeek == rday || rday == 0) {
if (hm >= rhm) {
data.add("Rule : " + rhm);
personSP = rule.getTemp();
......@@ -122,8 +122,8 @@ public class StartupRunner implements CommandLineRunner {
if (SERIAL.setMM(month)) oldMonth = month;
}
if (oldDay != day) {
if (SERIAL.setDD(day)) oldDay = day;
if (oldDay != dayMonth) {
if (SERIAL.setDD(dayMonth)) oldDay = dayMonth;
}
if (oldHour != hour) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment