Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/react-datetime.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-datetime",
"version": "3.1.0-unc-6",
"version": "3.1.0-unc-7",
"description": "A lightweight but complete datetime picker React.js component",
"homepage": "https://github.com/arqex/react-datetime",
"repository": {
Expand Down
6 changes: 6 additions & 0 deletions react-datetime.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ declare module ReactDatetime {
display as <time> <date>
*/
showTimeFirst?: boolean,

/*
In same format as the time format. If provided, will override the time format in determining
which counters are shown in the time display
*/
timeCountersFormat?: string,
}

interface DatetimeComponent extends React.ComponentClass<DatetimepickerProps> {
Expand Down
1 change: 1 addition & 0 deletions src/DateTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export default class Datetime extends React.Component {
showView: this._showView,
displayTimeZone: props.displayTimeZone,
showTimeZone: props.showTimeZone,
timeCountersFormat: props.timeCountersFormat,
};

// Probably updateOn, updateSelectedDate and setDate can be merged in the same method
Expand Down
2 changes: 2 additions & 0 deletions src/playground/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const App = () => {
onChange={setTime2}
initialViewMode='time'
showTimeZone
timeFormat={'hh:mma'}
timeCountersFormat={'hms'}
/>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/views/TimeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export default class TimeView extends React.Component {

getCounters() {
let counters = [];
let format = this.props.timeFormat;
let format = this.props.timeCountersFormat || this.props.timeFormat;

if ( format.toLowerCase().indexOf('h') !== -1 ) {
counters.push('hours');
Expand Down
7 changes: 7 additions & 0 deletions typings/DateTime.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ declare namespace ReactDatetimeClass {
display as <time> <date>
*/
showTimeFirst?: boolean,

/*
In same format as the time format. If provided, will override the time format in determining
which counters are shown in the time display
*/
timeCountersFormat?: string,

}

export interface DatetimepickerState {
Expand Down