web: Add timestamp display format to measure configuration.

This commit is contained in:
2020-03-14 22:45:59 -05:00
parent cf69ff2fa1
commit e9de9aebf3
10 changed files with 101 additions and 17 deletions

View File

@ -2,6 +2,7 @@ import { Component, Emit, Prop, Vue, Watch } from 'vue-property-decorator';
import { logService } from '@/services/logging';
import { Measure, MeasureConfig } from '@/models';
import TextMeasureConfigForm from './TextMeasureConfigForm.vue';
import moment from 'moment';
@Component({
components: {
@ -11,12 +12,41 @@ import TextMeasureConfigForm from './TextMeasureConfigForm.vue';
export class MeasureConfigForm extends Vue {
@Prop({}) public value!: MeasureConfig;
@Prop({}) public disabled: boolean = false;
@Prop({}) public measureExists: boolean = false;
public now = moment();
public formatStrings = [
'l',
'L',
'll',
'LL',
'lll',
'LLL',
'llll',
'LLLL',
'Y-MM-DD',
'Y-MM-DDTHH:mm',
'Y-MM-DDTHH:mm:ss',
'Y-MM-DDTHH:mm:ss.SSSZZ',
'MM/DD',
'MMM Do',
'HH:mm',
'hh:mmA'
];
private selectedFormat: string = 'l';
@Watch('value', { immediate: true, deep: true })
@Emit('input')
private onConfigChanged(newVal: MeasureConfig, oldVal: MeasureConfig) {
return newVal;
}
private formatSelectionChanged() {
if (this.selectedFormat !== 'custom') {
this.value.timestampDisplayFormat = this.selectedFormat;
}
}
}
export default MeasureConfigForm;