DateColumn
A column that displays a date in the specified format. By default L format is used, which contains the following info: full year, 2-digit month, and 2-digit day. Depending on the browser locale, the formatted date might look different. Intl.DateTimeFormat API is used to format the date. Here is an example of possible outputs depending on the browser locale:
// These options represent `L` format
const options = { year : 'numeric', month : '2-digit', day : '2-digit' };
new Intl.DateTimeFormat('en-US', options).format(new Date(2021, 6, 1)); // "07/01/2021"
new Intl.DateTimeFormat('ru-RU', options).format(new Date(2021, 6, 1)); // "01.07.2021"
// Formatting using Bryntum API
LocaleManager.applyLocale('En');
DateHelper.format(new Date(2021, 6, 1), 'L'); // "07/01/2021"
LocaleManager.applyLocale('Ru');
DateHelper.format(new Date(2021, 6, 1), 'L'); // "01.07.2021"
To learn more about available formats check out DateHelper docs.
The field this column reads data from should be a type of date.
Default editor is a DateField.
new Grid({
columns : [
{ type: 'date', text: 'Start date', format: 'YYYY-MM-DD', field: 'start' }
]
});
Useful configs
| Config | Description |
|---|---|
| format | Date display format string |
| min | Minimum selectable date |
| max | Maximum selectable date |
| step | Date picker step unit and amount |
See also
- TimeColumn - Column for time values
- DateHelper - Date formatting utilities
- DateField - Default editor widget
Configs
Configs are options you supply in a configuration object when creating an instance of this classProperties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of DateColumn class, or subclass thereof.
-
Max value for the cell editor
Has a corresponding max config.
-
Min value for the cell editor
Has a corresponding min config.
-
Identifies an object as an instance of DateColumn class, or subclass thereof.
Functions
Functions are methods available for calling on the class-
defaultRenderer( )private
Renderer that displays the date with the specified format. Also adds cls 'date-cell' to the cell.
-
groupRenderer( )private
Group renderer that displays the date with the specified format.