dbrekalo/vue-date-pick

Adding regularExpression-restriction to input-field

Opened this issue · 0 comments

jedet commented

Is it possible to add a prop like :inputRegEx which can be used to restrict the possible characters that are typed into the vue-date-pick ?
An example:

<template>
    <date-pick
        v-model="date"
        :hasInputElement="false"
        display-format="DD.MM.YYYY"
        :inputRegEx="(0?[1-9]|[12][0-9]|3[01])\.(0?[1-9]|1[012])\.((19|20)\\d\\d)"
    ></date-pick>
</template>

<script>
import DatePick from 'vue-date-pick';

export default {
    components: {DatePick},
    data: () => ({
        date: '12.02.2019'
    })
};
</script>