JSFiddle - React, Tailwind, and code Playground

by lynnaloo

JavaScript

enyo.kind({
    name: "InputWidget",
    type: "date",
    showing: false,
    components: [
        {kind: "onyx.InputDecorator", components: [
            {name: "input", kind: "onyx.Input", type: "date"}
        ]}
    ]    
});

enyo.kind({
    name: "Test",
    components: [{kind: "InputWidget", name: "input"}],
    
    isDateSupported: function () {
        var i = document.createElement("input");
        i.setAttribute("type", "date");
        return i.type !== "text";
    },
                                
    create: function () {
        this.inherited(arguments);
        if (this.isDateSupported()) {
            this.$.input.setShowing(true);
        } else {
            this.$.input.setShowing(false);
            alert("Date type is not supported in this browser!");
        }
    }    
});
var app = new Test();
app.renderInto(document.body);