reason-crossword-front/src/DatePicker/DatePicker.bs.js
2020-11-01 21:40:55 -05:00

27 lines
808 B
JavaScript

'use strict';
var Curry = require("bs-platform/lib/js/curry.js");
var React = require("react");
var Moment = require("moment");
function DatePicker(Props) {
var currentDate = Props.currentDate;
var updateDate = Props.updateDate;
var handleChange = function ($$event) {
var value = Moment($$event.target.value, "YYYY-MM-DD");
console.log("Updating date to " + String(value));
return Curry._1(updateDate, /* ChangeDate */{
_0: value
});
};
return React.createElement(React.Fragment, undefined, React.createElement("input", {
type: "date",
value: currentDate.format("YYYY-MM-DD"),
onChange: handleChange
}));
}
var make = DatePicker;
exports.make = make;
/* react Not a pure module */