Compare commits

...

4 Commits
v0.2.0 ... main

@ -1,6 +1,6 @@
{
"name": "@tiny-components/datepicker",
"version": "0.2.0",
"version": "0.3.2",
"description": "Datepicker for Desktop and Mobile",
"repository": {
"type": "git",

@ -66,17 +66,12 @@ export default {
this.state.date = dayjs(data.date)
})
this.createWeeksAndDays()
},
/**
*
*
*/
onBeforeUpdate() {
store.trigger(this.state.namespace + 'change', {
date: this.state.date
store.on('update-props', (data) => {
this.state.date = dayjs(this.props.date)
this.update()
})
this.createWeeksAndDays()
},
/**
@ -138,6 +133,11 @@ export default {
}
this.state.date = day
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update()
},
@ -151,6 +151,10 @@ export default {
this.state.date = this.state.date.month(event.target.value)
this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update()
},
@ -164,6 +168,10 @@ export default {
this.state.date = this.state.date.year(event.target.value)
this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update()
},
@ -178,6 +186,10 @@ export default {
this.state.date = this.state.date.subtract(1, 'month')
this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update()
},
@ -192,6 +204,10 @@ export default {
this.state.date = this.state.date.add(1, 'month')
this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update()
},
@ -205,6 +221,10 @@ export default {
this.state.date = this.state.date.subtract(1, 'year')
this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update()
},
@ -218,6 +238,10 @@ export default {
this.state.date = this.state.date.add(1, 'year')
this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update()
},

Loading…
Cancel
Save