expost calendar

pull/157/merge
yiminghe 10 years ago
parent 7a6f190e9e
commit 60c1f06bb1

@ -17,7 +17,7 @@ Locale.shortMonths = ['1月', '2月', '3月', '4月', '5月', '6月',
let defaultCalendarValue = new GregorianCalendar(zhCn); let defaultCalendarValue = new GregorianCalendar(zhCn);
defaultCalendarValue.setTime(Date.now()); defaultCalendarValue.setTime(Date.now());
export default React.createClass({ const AntDatepicker = React.createClass({
getInitialState() { getInitialState() {
var value; var value;
if (this.props.value) { if (this.props.value) {
@ -93,3 +93,19 @@ export default React.createClass({
); );
} }
}); });
const AntCalendar = React.createClass({
getDefaultProps() {
return {
locale: CalendarLocale,
prefixCls: 'ant-calendar',
};
},
render() {
return <Calendar {...this.props}/>;
}
});
AntDatepicker.Calendar = AntCalendar;
export default AntDatepicker;

@ -39,7 +39,7 @@
"is-equal-shallow": "~0.1.3", "is-equal-shallow": "~0.1.3",
"object-assign": "3.x", "object-assign": "3.x",
"rc-animate": "~1.2.0", "rc-animate": "~1.2.0",
"rc-calendar": "~3.14.2", "rc-calendar": "~3.15.0",
"rc-checkbox": "~1.1.1", "rc-checkbox": "~1.1.1",
"rc-collapse": "~1.3.0", "rc-collapse": "~1.3.0",
"rc-dialog": "~5.0.2", "rc-dialog": "~5.0.2",
@ -90,7 +90,7 @@
"scripts": { "scripts": {
"babel": "babel components --out-dir lib", "babel": "babel components --out-dir lib",
"release": "npm run clean && webpack --config webpack.config.production.js && webpack --config webpack.config.min.js && zip dist/${npm_package_name}-${npm_package_version}.zip -j dist dist/*", "release": "npm run clean && webpack --config webpack.config.production.js && webpack --config webpack.config.min.js && zip dist/${npm_package_name}-${npm_package_version}.zip -j dist dist/*",
"start": "npm run clean && nico server --watch", "start": "npm run clean && nico server --watch --port=9000",
"clean": "rm -rf _site dist", "clean": "rm -rf _site dist",
"deploy": "rm -rf node_modules && node scripts/install.js && npm run clean && webpack && webpack --config webpack.config.min.js && NODE_ENV=PRODUCTION nico build && node scripts/deploy.js", "deploy": "rm -rf node_modules && node scripts/install.js && npm run clean && webpack && webpack --config webpack.config.min.js && NODE_ENV=PRODUCTION nico build && node scripts/deploy.js",
"lint": "eslint components index.js --ext '.js,.jsx'", "lint": "eslint components index.js --ext '.js,.jsx'",

Loading…
Cancel
Save