Skip to content

Commit

Permalink
close quasarframework#1929 - Fix defaultView for QDatetime
Browse files Browse the repository at this point in the history
  • Loading branch information
pdanpdan committed Apr 12, 2018
1 parent 8d63e73 commit be9bf02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions dev/components/form/all.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@
<p class="q-subtitle">Date selected: {{ JSON.stringify(date) }}</p>
<q-datetime :dark="dark" :error="error" :warning="warning" :disable="disable" :readonly="readonly" type="date" formatModel="date" :clearable="clearable" class="q-ma-sm" @focus="onFocus" @blur="onBlur" @change="onChange" @input="onInput" @clear="onClear" v-model="date" placeholder="Date" :after="[ { icon: 'today', handler () { date = new Date('2018-10-21') } }]" />
<q-datetime :dark="dark" :error="error" :warning="warning" :disable="disable" :readonly="readonly" type="date" formatModel="date" :clearable="clearable" class="q-ma-sm" @focus="onFocus" @blur="onBlur" @change="onChange" @input="onInput" @clear="onClear" v-model="date" float-label="Date" />
<q-datetime :dark="dark" :error="error" :warning="warning" :disable="disable" :readonly="readonly" type="date" formatModel="date" :clearable="clearable" class="q-ma-sm" @focus="onFocus" @blur="onBlur" @change="onChange" @input="onInput" @clear="onClear" v-model="date" float-label="Date (default view month)" default-view="month" />
<q-datetime :dark="dark" :error="error" :warning="warning" :disable="disable" :readonly="readonly" type="date" formatModel="date" :clearable="clearable" class="q-ma-sm" @focus="onFocus" @blur="onBlur" @change="onChange" @input="onInput" @clear="onClear" v-model="date" float-label="Date (default view year)" default-view="year" />
<q-datetime :dark="dark" color="primary" :error="error" :warning="warning" :disable="disable" :readonly="readonly" type="date" formatModel="date" inverted :clearable="clearable" class="q-ma-sm" @focus="onFocus" @blur="onBlur" @change="val => { date = val; onChange(val) }" @input="onInput" @clear="onClear" :value="date" float-label="Date (onChange)" />
<q-datetime :dark="dark" :error="error" :warning="warning" :disable="disable" :readonly="readonly" type="date" formatModel="date" :clearable="clearable" class="q-ma-sm" @focus="onFocus" @blur="onBlur" @change="onChange" @input="onInput" @clear="onClear" v-model="date" :default-value="defaultDate" :float-label="`Date (default ${defaultDate})`" />
<q-datetime :dark="dark" color="orange" :error="error" :warning="warning" :disable="disable" :readonly="readonly" type="datetime" formatModel="date" inverted :clearable="clearable" class="q-ma-sm" @focus="onFocus" @blur="onBlur" @change="val => { date = val; onChange(val) }" @input="onInput" @clear="onClear" :value="date" :default-value="defaultDate" :float-label="`Datetime (default ${defaultDate}, onChange)`" />
Expand Down
3 changes: 0 additions & 3 deletions src/components/datetime/QDatetime.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ export default {
if (this.defaultView && target.view !== this.defaultView) {
target.setView(this.defaultView)
}
else {
target.setView()
}
}
this.model = clone(this.computedValue)
this.focused = true
Expand Down

0 comments on commit be9bf02

Please sign in to comment.