
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
An input that parses and formats dates using dehumanize-date and occasion.
npm install react-date
See example/app.js
'use strict';
var React = require('react');
var parse = require('dehumanize-date');
var format = require('occasion');
var DateInput = React.createFactory(require('react-date'));
var div = React.createFactory('div');
var h1 = React.createFactory('h1');
var p = React.createFactory('p');
var pre = React.createFactory('pre');
var code = React.createFactory('code');
module.exports = React.createClass({
getInitialState: function () {
return {
date: '2014-01-23'
};
},
render: function () {
return div({},
h1({}, 'Using "defaultValue"'),
p({}, 'This creates an editable input, as you would expect. ' +
'Note that it will not respond to changes in the model though.'),
DateInput({
className: ['form-control'],
format: 'DD/MM/YYYY',
defaultValue: this.state.date
}),
h1({}, 'Using "value" and no "onChange"'),
p({}, 'This creates a read only input that responds to changes.'),
DateInput({
className: ['form-control'],
format: 'DD-MM-YYYY',
value: this.state.date,
readOnly: true
}),
h1({}, 'Using "value" with "onChange"'),
p({}, 'This creates a typical, input, you can edit it and when the input "blurs" it will revert to the auto-formatted date.'),
DateInput({
className: ['form-control'],
format: 'DD/MM/YYYY',
value: this.state.date,
onChange: function (e) {
this.setState({date: e.target.value});
}.bind(this)
}),
h1({}, 'Using valueLink'),
p({}, 'This is exactly the same as using "value" with "onChange".'),
DateInput({
className: ['form-control'],
format: function (value) {
return value === parse('today') ? 'today' : format(value, 'DD-MM-YYYY');
},
valueLink: {
value: this.state.date,
requestChange: function (v) { this.setState({date: v}); }.bind(this)
}
}),
h1({}, 'Just a pre/code'),
p({}, 'Just so you can see the output.'),
pre({}, code({}, this.state.date))
);
}
});
MIT
FAQs
An input that parses and formats dates using dehumanize-date and occasion
We found that react-date demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.