Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
seriousme committed Oct 27, 2024
1 parent 646a636 commit 4539a17
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
32 changes: 16 additions & 16 deletions client/src/Forecast.svelte
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<script>
let { data } = $props();
function parseData(data){
try {
const fdata = JSON.parse(data);
const d = new Date(fdata.date);
fdata.localeDate = d.toLocaleDateString("nl-NL", {
weekday: "long",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
});
return fdata;
} catch (error) {
return data;
function parseData(data) {
try {
const fdata = JSON.parse(data);
const d = new Date(fdata.date);
fdata.localeDate = d.toLocaleDateString("nl-NL", {
weekday: "long",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
});
return fdata;
} catch (error) {
return data;
}
}
}
data = parseData(data);
data = parseData(data);
</script>

<table>
Expand Down
20 changes: 10 additions & 10 deletions client/src/mqttclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ const mqttDemo = {
this.publish(
"data/forecast/set",
JSON.stringify({
date: '2024-10-27T15:08:03.000Z',
weer: 'halfbewolkt',
max_temp: 16,
min_tem: 9,
windbft: 1,
windr: 'ZW',
neersl_perc_dag: 0,
zond_perc_dag: 47
})
);
date: "2024-10-27T15:08:03.000Z",
weer: "halfbewolkt",
max_temp: 16,
min_tem: 9,
windbft: 1,
windr: "ZW",
neersl_perc_dag: 0,
zond_perc_dag: 47,
}),
);
this.publish("config/auto/set", "on");
this.publish("config/sunblock/set", "on");
this.publish("config/useweather/set", "on");
Expand Down

0 comments on commit 4539a17

Please sign in to comment.