TobyMosque / app-extension-qdatetimepicker

QDateTimePicker for Quasar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: when manually editing date or time, resets the other

drasill opened this issue · comments

First, thank you for your widget, it's exactly what I needed.

It does work as I wish when using the pickers :

  • if I change the time, the date stays the same
  • if I change the date, the time stays the same

But it doesn't work when editing with editing the inputs by hand (keyboard) :

  • if I change the time, the date resets to 01/01/1970
  • if I change the date, the time resets to 00:00

Also, if I clear any of the field, the whole datetime is cleared.

Example GIF :
qdatetime

Example Code :

<template>
	<div class="q-pa-md">

		<div class="q-pa-md q-gutter-md" style="max-width: 700px">

			<q-datetime-picker
				dense
				filled
				style="max-width: 220px"
				mode="datetime"
				format24h
				auto-update-value
				label="Date"
				v-model="value"/>

			<div>
				<div class="row no-wrap q-col-gutter-md">
					<q-datetime-picker
						dense
						filled
						style="max-width: 180px"
						mode="date"
						auto-update-value
						label="Date"
						v-model="value"/>
					<q-datetime-picker
						dense
						filled
						style="max-width: 180px"
						mode="time"
						auto-update-value
						format24h
						label="Time"
						v-model="value"/>
				</div>
			</div>
		</div>

	</div>
</template>

<script>
export default {
	data() {
		return {
			value: '12/08/2017 15:18',
		}
	},
}
</script>

hello drasill, unfortunately, that is an expected behavior/side effect (because of the ISO support).
I'll try to make a improvement who take in account the current value.

Hi,
I've implemented passing a "base" value, could you review the pull request ?

Thank you for your time.

included at the rc7. i also updated the demo page (you can test the new behavior in the last section - shared value).