add back date selector

This commit is contained in:
David Tsay 2024-11-14 12:07:37 -08:00
parent 211272c201
commit 140184e6a8

View File

@ -37,6 +37,12 @@
aria-label="Start time" aria-label="Start time"
@input="validateAllBounds('startTime')" @input="validateAllBounds('startTime')"
/> />
<DatePicker
v-if="isTimeSystemUTCBased"
class="c-ctrl-wrapper--menus-left"
:default-date-time="formattedBounds.start"
@date-selected="dateSelected($event, 'start')"
/>
</div> </div>
<div class="pr-time-input pr-time-input__start-end-sep icon-arrows-right-left"></div> <div class="pr-time-input pr-time-input__start-end-sep icon-arrows-right-left"></div>
@ -52,6 +58,12 @@
aria-label="End time" aria-label="End time"
@input="validateAllBounds('endTime')" @input="validateAllBounds('endTime')"
/> />
<DatePicker
v-if="isTimeSystemUTCBased"
class="c-ctrl-wrapper--menus-left"
:default-date-time="formattedBounds.end"
@date-selected="dateSelected($event, 'end')"
/>
</div> </div>
<div class="pr-time-input pr-time-input--buttons"> <div class="pr-time-input pr-time-input--buttons">
@ -72,7 +84,12 @@
</template> </template>
<script> <script>
import DatePicker from './DatePicker.vue';
export default { export default {
components: {
DatePicker
},
inject: [ inject: [
'openmct', 'openmct',
'isTimeSystemUTCBased', 'isTimeSystemUTCBased',
@ -235,6 +252,10 @@ export default {
if ($event.target.className.indexOf('c-button icon-x') > -1) { if ($event.target.className.indexOf('c-button icon-x') > -1) {
this.$emit('dismiss'); this.$emit('dismiss');
} }
},
dateSelected(date, refName) {
this.formattedBounds[refName] = this.timeSystemFormatter.format(date);
this.validateInput(refName);
} }
} }
}; };