
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
vue-multi-date-picker
Advanced tools
A date picker for vue2.x support multi selection
# clone
git clone git@github.com:zhaokuohaha/vue-multi-date-picker.git
cd vue-multi-date-picker
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
property | type | defaults | comment |
---|---|---|---|
model | Array (multi = true) , Date (multi = false) | - | the model of date picker |
multi | Boolean | true | use multi select |
disp | Array | ['日', '一', '二', '三', '四', '五', '六','年', '月', '取消', '确定'] | Customize display text. The order of array must strict |
lang | String | 'zh' | Set to 'en' to translate to english |
format | Function | function (date) { return date.toLocaleDateString(); } | Accepts a function with a date argument and returns a string |
always-display | Boolean | false | Always display the date picker |
Notice: selected dates are UTC formatted
Copy /src/lib/multiDatePicker.vue
to your project
Use as component
<template>
<div>
<m-date-picker v-model="date" :multi="multi" :always-display="false" :format="formatDate"></m-date-picker>
</div>
</template>
<script>
import mDatePicker from 'path/to/multiDatePicker'
export default {
data () {
return {
multi: true,
date: []
}
},
components: {
'm-date-picker': mDatePicker
},
methods: {
formatDate(date) {
return data.toLocaleDateString();
}
}
}
</script>
npm install -S vue-multi-date-picker
// main.js
import mDatePicker from 'vue-multi-date-picker'
// ...
Vue.use(mDatePicker)
<!-- your component -->
<template>
<div>
<m-date-picker v-model="date" :multi="multi" :always-display="false" :format="formatDate"></m-date-picker>
</div>
</template>
<script>
export default {
data () {
return {
multi: true,
date: []
}
},
methods: {
formatDate(date) {
return data.toLocaleDateString();
}
}
}
</script>
For detailed explanation on how things work, consult the docs for vue-loader.
FAQs
A date picker for vue2.x support multi selection
The npm package vue-multi-date-picker receives a total of 217 weekly downloads. As such, vue-multi-date-picker popularity was classified as not popular.
We found that vue-multi-date-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.