-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
33 lines (31 loc) · 828 Bytes
/
index.js
File metadata and controls
33 lines (31 loc) · 828 Bytes
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
'use strict';
/**
* Datetime Input Plugin
*
*
* A simple plugin for a single date and time
*/
const validation = require('./lib/validation.js');
/**
* Single Datetime Input Plugin
* @module datetimeInputPlugin
*/
module.exports = {
name: 'Datetime',
description: 'A simple plugin for a single date and time',
validation: {
datetimeValidation: validation,
},
inputs: {
datetime: {
validation: {
function: 'datetimeValidation',
on: 'blur',
},
label: 'Date',
type: 'datetime-local',
placeholder: new Date().toLocaleDateString(),
},
},
html: '<label for="{{datetime.id}}">{{datetime.label}}</label><input type="{{datetime.type}}" id="{{datetime.id}}" name="{{datetime.name}}" value="{{datetime.value}}" placeholder="{{datetime.placeholder}}" />',
};