0.1.1 • Published 7 years ago
vue2-datetimepicker v0.1.1
Vue 2 Date Time Picker
Works great with Semantic UI.
Warning: no time picker coded, yet!
Semantic UI CSS
Import src/calendar.less
to render a Calendar with a Semantic UI ish look.
With webpack, on a single file component, put @import '~vue2-datetimepicker/src/calendar.less'
on your style
tag.
Components
List of components available
DatePicker
An HTML Input with an pop-up containing Calendar
Attributes
Type | Attribute | Default | Description |
---|---|---|---|
String | enter-active-class | animate transition scale in | PopUp animating classes. See https://vuejs.org/v2/guide/transitions.html#Custom-Transition-Classes |
String | format | Localized format for L token (based on locale attribute) | Locale friendly date format |
String | format-value | YYYY-MM-DD | Backend friendly format according to HTML standard |
String | leave-active-class | animate transition scale out | PopUp animating classes. See https://vuejs.org/v2/guide/transitions.html#Custom-Transition-Classes |
String | locale | User's current preferred language | A string representing the language version as defined in BCP 47. |
moment , Date , String | max | undefined | Maximum date allowed (inclusive) |
moment , Date , String | min | undefined | Minimum date allowed (inclusive) |
moment , Date , String | popup-class | visible ui custom bottom right popup for datepicker | Classes to apply to PopUp component |
moment , Date , String | v-model | undefined | Vue's two-way binding |
moment , Date , String | value | undefined | Default date |
Events
blur
– HTML Input's eventchange
– HTML Input's eventclick
– HTML Input's eventcontextmenu
– HTML Input's eventfocus
– HTML Input's eventinput
– HTML Input's eventinvalid
– HTML Input's eventkeydown
– HTML Input's eventkeypress
– HTML Input's eventkeyup
– HTML Input's eventmousedown
– HTML Input's eventmouseenter
– HTML Input's eventmouseleave
– HTML Input's eventmouseout
– HTML Input's eventmouseover
– HTML Input's eventmouseup
– HTML Input's eventpointerlockchange
– HTML Input's eventpointerlockerror
– HTML Input's eventreset
– HTML Input's eventsearch
– HTML Input's eventselect
– HTML Input's eventselect
– HTML Input's eventsubmit
– HTML Input's eventwheel
– HTML Input's event
Methods
emitFocus
– Called when input has received focushide
– Hides PopUphideBlurred
– Called when user clicks outside PopUpsetDate
– Emitsinput
event preserving original type of thevalue
attributeshow
– Shows PopUptoggle
– Toggles PopUp visibility
Slots
hidden-input
– HTML Hidden Input with the date formatted based on theformat-value
attributeinput
– HTML Text Input with the date formatted based on theformat
attributepopup
– PopUp to be shown when the input receives focus
PopUp
A container for Calendar
Attributes
Type | Attribute | Default | Description |
---|---|---|---|
String | locale | User's current preferred language | A string representing the language version as defined in BCP 47. |
moment , Date , String | max | undefined | Maximum date allowed (inclusive) |
moment , Date , String | min | undefined | Minimum date allowed (inclusive) |
moment , Date , String | v-model | undefined | Vue's two-way binding |
moment , Date , String | value | undefined | Default date |
Methods
setDate
– Emitsinput
event
Slots
No slots for this component
Events
input
–value
has changed
Calendar
A calendar view
Attributes
Type | Attribute | Default | Description |
---|---|---|---|
String | locale | User's current preferred language | A string representing the language version as defined in BCP 47. |
moment , Date , String | max | undefined | Maximum date allowed (inclusive) |
moment , Date , String | min | undefined | Minimum date allowed (inclusive) |
Boolean | readonly | Wether v-model or value is defined | The calendar is read only. No changes will affect v-model or value . |
moment , Date , String | v-model | undefined | Vue's two-way binding |
moment , Date , String | value | undefined | Default date |
Events
input
–value
has changed
Methods
addMonth
– Shows next month if date is beforemax
attributeisBetween(moment)
– Whether amoment
instance is betweenmin
anmax
attributes, inclusiveisMax
– Ismax
attribute a validDate
ormoment
instance?isMin
– Ismin
attribute a validDate
ormoment
instance?isToday(moment)
– Whether amoment
instance is todayrotate(WheelEvent)
– Called when mouse's wheel is used on month namesetDate
– Emitsinput
event preserving original type of thevalue
attribute. Checks if the selected date is betweenmin
anmax
attributes, inclusive.setLocale(String)
– Changes locale of the calendarsubMonth
– Shows previous month if date is aftermin
attribute
Slots
No slots for this component