diff --git a/docs/src/app/components/pages/components/date-picker.jsx b/docs/src/app/components/pages/components/date-picker.jsx
index ea8ff269571d3a..abf7f4384d233a 100644
--- a/docs/src/app/components/pages/components/date-picker.jsx
+++ b/docs/src/app/components/pages/components/date-picker.jsx
@@ -29,6 +29,27 @@ export default class DatePickerPage extends React.Component {
{
name: 'Props',
infoArray: [
+ {
+ name: 'DateTimeFormat',
+ type: 'func',
+ header: 'default: custom one that only support en-US locale',
+ desc: 'Constructor for time formatting. Follow this specificaction: ' +
+ 'ECMAScript Internationalization API 1.0 (ECMA-402).',
+ },
+ {
+ name: 'locale',
+ type: 'string',
+ header: 'default: en-US',
+ desc: 'Locale used for formating date. If you are not using the default value, ' +
+ 'you have to provide a DateTimeFormat that support it. You can use Intl.DateTimeFormat' +
+ ' if it\'s supported by your environment. https://github.com/andyearnshaw/Intl.js is a good polyfill.',
+ },
+ {
+ name: 'wording',
+ type: 'object',
+ header: 'default: {ok: \'OK\', cancel: \'Cancel\' }',
+ desc: 'Wording used inside the button of the dialog.',
+ },
{
name: 'autoOk',
type: 'bool',
diff --git a/src/date-picker/calendar-toolbar.jsx b/src/date-picker/calendar-toolbar.jsx
index 4c7edaec797342..4c77da739a1b3b 100644
--- a/src/date-picker/calendar-toolbar.jsx
+++ b/src/date-picker/calendar-toolbar.jsx
@@ -1,5 +1,4 @@
const React = require('react');
-const DateTime = require('../utils/date-time');
const IconButton = require('../icon-button');
const Toolbar = require('../toolbar/toolbar');
const ToolbarGroup = require('../toolbar/toolbar-group');
@@ -44,6 +43,8 @@ const CalendarToolbar = React.createClass({
},
propTypes: {
+ DateTimeFormat: React.PropTypes.func.isRequired,
+ locale: React.PropTypes.string.isRequired,
displayDate: React.PropTypes.object.isRequired,
nextMonth: React.PropTypes.bool,
onMonthChange: React.PropTypes.func,
@@ -81,10 +82,16 @@ const CalendarToolbar = React.createClass({
},
render() {
- const dateTimeFormated = new DateTime.DateTimeFormat('en-US', {
+ const {
+ DateTimeFormat,
+ locale,
+ displayDate,
+ } = this.props
+
+ const dateTimeFormated = new DateTimeFormat(locale, {
month: 'long',
year: 'numeric',
- }).format(this.props.displayDate);
+ }).format(displayDate);
const nextButtonIcon = this.state.muiTheme.isRtl ? : ;
const prevButtonIcon = this.state.muiTheme.isRtl ? : ;
diff --git a/src/date-picker/calendar.jsx b/src/date-picker/calendar.jsx
index 7288ae25b1a6e6..f554ac4176a271 100644
--- a/src/date-picker/calendar.jsx
+++ b/src/date-picker/calendar.jsx
@@ -34,6 +34,8 @@ const Calendar = React.createClass({
},
propTypes: {
+ DateTimeFormat: React.PropTypes.func.isRequired,
+ locale: React.PropTypes.string.isRequired,
disableYearSelection: React.PropTypes.bool,
initialDate: React.PropTypes.object,
isActive: React.PropTypes.bool,
@@ -133,10 +135,16 @@ const Calendar = React.createClass({
};
const weekTitleDayStyle = this.prepareStyles(styles.weekTitleDay);
+ const {
+ DateTimeFormat,
+ locale,
+ } = this.props;
return (
,
@@ -123,7 +141,7 @@ const DatePickerDialog = React.createClass({
actions.push(