Skip to content
This repository has been archived by the owner on Jun 26, 2022. It is now read-only.

Commit

Permalink
Added input mask
Browse files Browse the repository at this point in the history
  • Loading branch information
techouse committed May 14, 2019
1 parent c0f17e9 commit 4e8c483
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/js/field.js": "/js/field.js?id=91321870b2d927200133",
"/js/field.js": "/js/field.js?id=4c62f3dd86681762ac45",
"/css/field.css": "/css/field.css?id=f8156e73494b4bfc878f"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"laravel-nova": "^1.0",
"moment": "^2.24.0",
"postcss-discard-comments": "^4.0.2",
"vue-template-compiler": "^2.6.10"
"vue-template-compiler": "^2.6.10",
"vue-the-mask": "^0.11.1"
},
"dependencies": {
"vue": "^2.6.10"
Expand Down
12 changes: 11 additions & 1 deletion resources/js/components/IntlDateTimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
:class="{'!cursor-not-allowed': disabled}"
:value="value"
:name="field.name"
:placeholder="placeholder"
:placeholder="momentjsFormat"
v-mask="maskFormat"
type="text">
</template>

Expand All @@ -14,6 +15,7 @@
import DateTimeFormatConverter from '../DateTimeFormatConverter'
import {momentjsLocaleMapping} from '../InternationalMapper'
import {locale as locales} from '../Locale'
import {mask} from 'vue-the-mask'
export default {
props: {
Expand Down Expand Up @@ -56,6 +58,10 @@
}
},
directives: {
mask
},
data() {
return {
flatpickr: null
Expand Down Expand Up @@ -95,6 +101,10 @@
}
},
maskFormat() {
return this.momentjsFormat.replace(/\w/g, '#')
},
placeholder() {
return moment().format(this.momentjsFormat)
}
Expand Down

0 comments on commit 4e8c483

Please sign in to comment.