-
Notifications
You must be signed in to change notification settings - Fork 875
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
496 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<template> | ||
<div class="flex flex-col"> | ||
<div>Time: {{ time ? time : 'Empty' }}</div> | ||
<v-date-picker | ||
v-model="time" | ||
mode="time" | ||
:model-config="modelConfig" | ||
:popover="{ visibility: 'click' }" | ||
timezone="utc" | ||
> | ||
<template v-slot="{ inputValue, inputEvents }"> | ||
<input | ||
class="px-2 py-1 rounded border-2 focus:border-blue-300 focus:outline-none" | ||
:value="inputValue" | ||
v-on="inputEvents" | ||
/> | ||
</template> | ||
</v-date-picker> | ||
<div>Date: {{ date ? date : 'Empty' }}</div> | ||
<v-date-picker | ||
v-model="date" | ||
mode="dateTime" | ||
:model-config="modelConfig" | ||
:masks="masks" | ||
timezone="utc" | ||
> | ||
<template v-slot="{ inputValue, inputEvents }"> | ||
<input | ||
class="px-2 py-1 rounded border-2 focus:border-blue-300 focus:outline-none" | ||
:value="inputValue" | ||
v-on="inputEvents" | ||
/> | ||
</template> | ||
</v-date-picker> | ||
<div>Start: {{ range ? range.start : 'Empty' }}</div> | ||
<div>End: {{ range ? range.end : 'Empty' }}</div> | ||
<v-date-picker | ||
v-model="range" | ||
mode="time" | ||
:model-config="modelConfig" | ||
timezone="utc" | ||
is-range | ||
> | ||
<template v-slot="{ inputValue, inputEvents }"> | ||
<input | ||
class="px-2 py-1 rounded border-2" | ||
:value="inputValue.start" | ||
v-on="inputEvents.start" | ||
/> | ||
<input | ||
class="px-2 py-1 rounded border-2" | ||
:value="inputValue.end" | ||
v-on="inputEvents.end" | ||
/> | ||
</template> | ||
</v-date-picker> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
githubTitle: 'Time cannot be null', | ||
data() { | ||
return { | ||
date: '2021-01-15T04:15:00.123Z', | ||
range: { | ||
start: '2021-01-01T00:00:00.000Z', | ||
end: '2021-01-24T00:00:00.000Z', | ||
}, | ||
time: '2021-01-15T04:15:00.000Z', | ||
modelConfig: { | ||
type: 'string', | ||
fillDate: new Date(1920, 0, 1), | ||
// timeAdjust: '09:00', | ||
}, | ||
masks: { | ||
inputDateTime: 'MM/DD/YYYY', | ||
}, | ||
}; | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<template> | ||
<form ref="form"> | ||
<v-date-picker v-model="range" mode="dateTime" is-range is24hr> | ||
<template v-slot="{ inputValue, inputEvents }"> | ||
<div class="flex justify-center items-center w-full"> | ||
<!-- <p>{{ item.fieldChName + ':' }}</p> --> | ||
<input | ||
:value="inputValue.start" | ||
v-on="inputEvents.start" | ||
class="border px-2 py-1 w-48 rounded focus:outline-none focus:border-indigo-300" | ||
/> | ||
- | ||
<input | ||
:value="inputValue.end" | ||
v-on="inputEvents.end" | ||
class="border px-2 py-1 w-48 rounded focus:outline-none focus:border-indigo-300" | ||
/> | ||
</div> | ||
</template> | ||
</v-date-picker> | ||
<button role="button" @click.prevent="clearForm">Clear</button> | ||
</form> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
githubTitle: 'vuetify this.$refs.form.reset() can not reset the range inputs', | ||
data() { | ||
return { | ||
range: { | ||
start: new Date(2021, 2, 1), | ||
end: new Date(2021, 1, 5), | ||
}, | ||
}; | ||
}, | ||
methods: { | ||
clearForm() { | ||
this.$refs.form.reset(); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<v-date-picker :attributes="attributes" v-model="date" mode="time" /> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
githubTitle: 'Docs/Attributes is [object object]', | ||
data() { | ||
return { | ||
date: new Date(2021, 1, 14), | ||
attributes: [ | ||
{ | ||
highlight: true, | ||
dates: new Date(), | ||
}, | ||
], | ||
}; | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
<v-date-picker :popover="{ placement: 'left' }" v-model="date"> | ||
<template v-slot="{ togglePopover }"> | ||
<button @click="togglePopover">Click to open calendar</button> | ||
</template> | ||
</v-date-picker> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
githubTitle: `popover.placement doesn't work`, | ||
data() { | ||
return { | ||
date: new Date(), | ||
popover: { | ||
placement: 'left', | ||
}, | ||
}; | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<v-date-picker v-model="range" @drag="dragRange = $event" is-range /> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
githubTitle: 'Update the model on partial result on range selection', | ||
data() { | ||
return { | ||
range: null, | ||
dragRange: null, | ||
}; | ||
}, | ||
watch: { | ||
dragRange(range) { | ||
console.log(JSON.stringify(range)); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.