state of the mqtt
This commit is contained in:
@@ -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()],
|
||||
|
||||
Reference in New Issue
Block a user