forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatetime-props.js
More file actions
63 lines (60 loc) · 1.21 KB
/
datetime-props.js
File metadata and controls
63 lines (60 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { isDate } from '../../utils/is'
export const modelValidator = v => {
const type = typeof v
return (
v === null || v === undefined ||
type === 'number' || type === 'string' ||
isDate(v)
)
}
export const inline = {
value: {
validator: modelValidator,
required: true
},
defaultValue: {
type: [String, Number, Date],
default: null
},
type: {
type: String,
default: 'date',
validator: v => ['date', 'time', 'datetime'].includes(v)
},
color: {
type: String,
default: 'primary'
},
dark: Boolean,
min: {
validator: modelValidator,
default: null
},
max: {
validator: modelValidator,
default: null
},
firstDayOfWeek: Number,
formatModel: {
type: String,
default: 'auto',
validator: v => ['auto', 'date', 'number', 'string'].includes(v)
},
format24h: {
type: [Boolean, Number],
default: 0,
validator: v => [true, false, 0].includes(v)
},
defaultView: {
type: String,
validator: v => ['year', 'month', 'day', 'hour', 'minute'].includes(v)
},
minimal: Boolean
}
export const input = {
format: String,
placeholder: String,
okLabel: String,
cancelLabel: String,
displayValue: String
}