Skip to content

Commit

Permalink
bug fix #49
Browse files Browse the repository at this point in the history
  • Loading branch information
weifeiyue committed Sep 3, 2018
1 parent a6e3078 commit 7c07df7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/vue-datepicker-local.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/vue-datepicker-local.js

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-datepicker-local",
"version": "1.0.18",
"version": "1.0.19",
"description": "A datepicker for Vue.js",
"main": "src/index.js",
"files": [
Expand All @@ -10,7 +10,14 @@
"README.md"
],
"browserify": {
"transform": [["babelify"],["vueify"]]
"transform": [
[
"babelify"
],
[
"vueify"
]
]
},
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
Expand Down
9 changes: 6 additions & 3 deletions src/VueDatepickerLocalCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<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>
</div>
<div :class="`${pre}-months`" v-show="showMonths">
<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>
<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>
</div>
<div :class="`${pre}-years`" v-show="showYears">
<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>
<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>
</div>
<div :class="`${pre}-hours`" v-show="showHours">
<div :class="`${pre}-title`">{{local.hourTip}}</div>
Expand Down Expand Up @@ -220,14 +220,17 @@ export default {
const $this = this
let year = ''
let month = ''
let day = ''
info && info.n && $this.nm()
info && info.p && $this.pm()
if (info === 'h') {
const time = $this.get(this.value)
year = time.year
month = time.month
} else if (info === 'm' || info === 'y') {
day = 1
}
const _time = new Date(year || $this.year, month || $this.month, $this.day, $this.hour, $this.minute, $this.second)
const _time = new Date(year || $this.year, month || $this.month, day || $this.day, $this.hour, $this.minute, $this.second)
if ($this.left && parseInt(_time.getTime() / 1000) > $this.end) {
this.$parent.dates[1] = _time
}
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const banner =
'vue-datetime-local.js v1.0.18\n' +
'vue-datetime-local.js v1.0.19\n' +
'(c) 2017-' + new Date().getFullYear() + ' weifeiyue\n' +
'Released under the MIT License.'
module.exports = {
Expand Down

0 comments on commit 7c07df7

Please sign in to comment.