refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s

This commit is contained in:
Kroonk
2026-05-22 16:19:55 +02:00
parent 38cc4c09ca
commit a213a1dba0
2215 changed files with 242567 additions and 6015 deletions

View File

@@ -0,0 +1,108 @@
<template>
<div>
<!-- Timezone -->
<div class="form-group">
<form-select
:id="'timezone'"
:value="updatedTimezone"
:options="timezones"
:title="$t('settings.timezone')"
:required="true"
:iclass="'form-control'"
@input="timezoneUpdate"
/>
</div>
<!-- Reminders -->
<div class="form-group">
<form-select
:id="'reminder_time'"
:value="updatedReminder"
:options="hours"
:title="$t('settings.reminder_time_to_send')"
:required="true"
:iclass="'form-control'"
@input="reminderUpdate"
/>
<small class="form-text text-muted" v-html="message"></small>
</div>
</div>
</template>
<script>
export default {
props: {
timezone: {
type: String,
default: 'UTC',
},
timezones: {
type: Array,
default: function () {
return [];
}
},
reminder: {
type: String,
default: '',
},
hours: {
type: Array,
default: function () {
return [];
}
}
},
data() {
return {
message: '',
updatedTimezone: '',
updatedReminder: ''
};
},
mounted() {
this.prepareComponent();
},
methods: {
prepareComponent() {
this.updatedReminder = this.reminder;
this.updatedTimezone = this.timezone;
this.computeMessage();
},
timezoneUpdate: function(event) {
this.updatedTimezone = event;
this.computeMessage();
},
reminderUpdate: function(event) {
this.updatedReminder = event;
this.computeMessage();
},
computeMessage() {
var moment = require('moment-timezone');
moment.locale(this._i18n.locale);
moment.tz.setDefault('UTC');
var now = moment();
var t = now.format('YYYY-MM-DD ' + this.updatedReminder + ':00');
var date = moment.tz(t, this.updatedTimezone);
if (date.isBefore(now)) {
date = date.add(1, 'days');
}
this.message = this.$t('settings.reminder_time_to_send_help', {
dateTime: date.format('LLL'),
dateTimeUtc: date.utc().format('YYYY-MM-DD HH:mm z')
});
}
}
};
</script>