This repository was archived by the owner on Jul 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtime-format.tsx
More file actions
41 lines (38 loc) · 2.55 KB
/
time-format.tsx
File metadata and controls
41 lines (38 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import * as ReactDOM from 'react-dom';
import * as React from 'react';
import { TimePickerComponent } from '@syncfusion/ej2-react-calendars';
import { SampleBase } from '../common/sample-base';
import './timepicker-component.css';
export class Format extends SampleBase<{}, {}> {
private value: Date = new Date();
private interval: number = 60;
private customFormat: string = 'HH:mm';
render() {
return (
<div className='control-pane format'>
<div className='control-section'>
<div className='timepicker-control-section'>
<TimePickerComponent value={this.value} step={this.interval} format={this.customFormat}></TimePickerComponent>
</div>
</div>
<div id="action-description">
<p>
The TimePicker has been customized with 24-hour <code>format</code> with 60 minutes <code>interval</code>. Click the TimePicker icon to a select a time from 00:00 to 23:00 from the TimePicker popup.</p>
</div>
<div id='description'>
<p>
TimePicker provides an option to customize the display format of the time value using the
<a href="https://ej2.syncfusion.com/react/documentation/timepicker/getting-started.html#setting-the-time-format" target="_blank">format</a>property. It accepts <a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings"
target="_blank"> standard </a>
<a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings" target="_blank"> custom date and time format strings</a>as specified in MSDN.
</p>
<p> Here, the time value displayed in 24-hour format with <code> 60 </code> minute step interval. To know more about custom time formatting, refer the
<a href="https://ej2.syncfusion.com/react/documentation/base/internationalization.html#custom-formats" target="_blank"> Parsing and formatting</a> section. By default, TimePicker component is formatted with `en` (English) culture.
</p>
<p>More information about TimePicker and it's configuration can be found in the
<a href="https://ej2.syncfusion.com/react/documentation/timepicker/getting-started.html#create-a-simple-timepicker" target="_blank"> documentation section</a>.</p>
</div>
</div>
)
}
}