Skip to content

Commit 7c07df7

Browse files
committed
bug fix #49
1 parent a6e3078 commit 7c07df7

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

dist/vue-datepicker-local.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-datepicker-local.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-datepicker-local",
3-
"version": "1.0.18",
3+
"version": "1.0.19",
44
"description": "A datepicker for Vue.js",
55
"main": "src/index.js",
66
"files": [
@@ -10,7 +10,14 @@
1010
"README.md"
1111
],
1212
"browserify": {
13-
"transform": [["babelify"],["vueify"]]
13+
"transform": [
14+
[
15+
"babelify"
16+
],
17+
[
18+
"vueify"
19+
]
20+
]
1421
},
1522
"scripts": {
1623
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",

src/VueDatepickerLocalCalendar.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
<a v-for="(j,i) in days" @click="is($event)&&(day=j.i,ok(j))" :class="[(j.p||j.n)?`${pre}-date-out`:'',status(j.y,j.m,j.i,hour,minute,second,'YYYYMMDD')]" :key="i">{{j.i}}</a>
2424
</div>
2525
<div :class="`${pre}-months`" v-show="showMonths">
26-
<a v-for="(i,j) in local.months" @click="is($event)&&(showMonths=(m==='M'),month=j,(m==='M'&&ok()))" :class="[status(year,j,day,hour,minute,second,'YYYYMM')]" :key="j">{{i}}</a>
26+
<a v-for="(i,j) in local.months" @click="is($event)&&(showMonths=(m==='M'),month=j,(m==='M'&&ok('m')))" :class="[status(year,j,day,hour,minute,second,'YYYYMM')]" :key="j">{{i}}</a>
2727
</div>
2828
<div :class="`${pre}-years`" v-show="showYears">
29-
<a v-for="(i,j) in years" @click="is($event)&&(showYears=(m==='Y'),year=i,(m==='Y'&&ok()))" :class="[(j===0||j===11)?`${pre}-date-out`:'',status(i,month,day,hour,minute,second,'YYYY')]" :key="j">{{i}}</a>
29+
<a v-for="(i,j) in years" @click="is($event)&&(showYears=(m==='Y'),year=i,(m==='Y'&&ok('y')))" :class="[(j===0||j===11)?`${pre}-date-out`:'',status(i,month,day,hour,minute,second,'YYYY')]" :key="j">{{i}}</a>
3030
</div>
3131
<div :class="`${pre}-hours`" v-show="showHours">
3232
<div :class="`${pre}-title`">{{local.hourTip}}</div>
@@ -220,14 +220,17 @@ export default {
220220
const $this = this
221221
let year = ''
222222
let month = ''
223+
let day = ''
223224
info && info.n && $this.nm()
224225
info && info.p && $this.pm()
225226
if (info === 'h') {
226227
const time = $this.get(this.value)
227228
year = time.year
228229
month = time.month
230+
} else if (info === 'm' || info === 'y') {
231+
day = 1
229232
}
230-
const _time = new Date(year || $this.year, month || $this.month, $this.day, $this.hour, $this.minute, $this.second)
233+
const _time = new Date(year || $this.year, month || $this.month, day || $this.day, $this.hour, $this.minute, $this.second)
231234
if ($this.left && parseInt(_time.getTime() / 1000) > $this.end) {
232235
this.$parent.dates[1] = _time
233236
}

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path')
22
const webpack = require('webpack')
33
const ExtractTextPlugin = require('extract-text-webpack-plugin')
44
const banner =
5-
'vue-datetime-local.js v1.0.18\n' +
5+
'vue-datetime-local.js v1.0.19\n' +
66
'(c) 2017-' + new Date().getFullYear() + ' weifeiyue\n' +
77
'Released under the MIT License.'
88
module.exports = {

0 commit comments

Comments
 (0)