Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caolan form missing datetimelocal #221

Open
sh3ngsh3ng opened this issue Dec 13, 2021 · 0 comments
Open

Caolan form missing datetimelocal #221

sh3ngsh3ng opened this issue Dec 13, 2021 · 0 comments

Comments

@sh3ngsh3ng
Copy link

sh3ngsh3ng commented Dec 13, 2021

npm install missing the chunk of code below:

var datetimeLocalWidget = input('datetime-local');
exports.datetimeLocal = function (options) {
    var opt = options || {};
    var w = datetimeLocalWidget(opt);
    w.formatValue = function (value) {
        if (!value) {
            return null;
        }

        var date = is.date(value) ? value : new Date(value);

        if (isNaN(date.getTime())) {
            return null;
        }

        return date.toISOString().slice(0, 23);
    };
    return w;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants