Skip to content

Instantly share code, notes, and snippets.

@mwiencek
Created March 7, 2015 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwiencek/1ec0d53747ebaa9bff6c to your computer and use it in GitHub Desktop.
Save mwiencek/1ec0d53747ebaa9bff6c to your computer and use it in GitHub Desktop.
// This file is part of MusicBrainz, the open internet music database.
// Copyright (C) 2015 MetaBrainz Foundation
// Licensed under the GPL version 2, or (at your option) any later version:
// http://www.gnu.org/licenses/gpl-2.0.txt
var React = require('react');
var i18n = require('../../../common/i18n.js');
var PartialDate = React.createClass({
render: function () {
var date = this.props.date;
// var error = ???
return (
<tr>
<td class="section">{this.props.label}</td>
<td class="partial-date">
<input value={date.year} maxlength="4" placeholder={i18n.l('YYYY')} size="4" />
<input value={date.month} maxlength="2" placeholder={i18n.l('MM')} size="4" />
<input value={date.day} maxlength="2" placeholder={i18n.l('DD')} size="4" />
{error && <div class="error">{error}</div>}
</td>
</tr>
);
}
});
module.exports = PartialDate;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment