state of the mqtt

This commit is contained in:
cpu
2025-05-12 23:58:46 +02:00
parent 413e7ce4cf
commit 634ef1e511
5 changed files with 116 additions and 58 deletions

View File

@@ -6,29 +6,21 @@ import { resolve } from 'path';
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
const appVersion = packageJson.version;
// Get current date (this will be the server's local time where the build runs)
const now = new Date();
const dateTimeFormat = new Intl.DateTimeFormat('sk-SK', {
// Options for date formatting, targeting CET/CEST
const dateTimeFormatOptionsCEST = {
year: 'numeric', month: '2-digit', day: '2-digit',
hour: '2-digit', minute: '2-digit', second: '2-digit',
hour12: false
});
hour12: false, // Use 24-hour format
timeZone: 'Europe/Bratislava' // Or 'Europe/Prague', 'Europe/Berlin', etc. (any major CET/CEST city)
// This will automatically handle Daylight Saving Time (CEST vs CET)
};
const parts = dateTimeFormat.formatToParts(now);
let day = '', month = '', year = '', hour = '', minute = '', second = '';
// Generate build time string using a specific time zone that observes CET/CEST
const appBuildTime = now.toLocaleString('sk-SK', dateTimeFormatOptionsCEST) + " CEST/CET"; // Add timezone indicator for clarity
parts.forEach(part => {
switch (part.type) {
case 'day': day = part.value; break;
case 'month': month = part.value; break;
case 'year': year = part.value; break;
case 'hour': hour = part.value; break;
case 'minute': minute = part.value; break;
case 'second': second = part.value; break;
}
});
// Assemble the date part without unwanted spaces
const appBuildTime = `${day}.${month}.${year} ${hour}:${minute}:${second}`;
export default defineConfig({
plugins: [vue()],