This sample demonstrates how to apply date formatting in the Syncfusion JavaScript Pivot Table (PivotView) component. Date formatting helps display date fields in a user-friendly format, making reports easier to read and analyze.
The Pivot Table (PivotView) is a powerful component for summarizing and analyzing large datasets. In this example:
- We generate a dataset with fields like
ProductID,City,Date,CustomerName,Sold, andInStock. - The Date field is formatted using the pattern
dd/MM/yyyy-hh:mm a(e.g.,21/10/2025-08:15 PM). - The Pivot Table is configured with:
- Rows:
Date - Columns:
ProductID - Values:
Sold(Units Sold),InStock(Stock Available)
- Rows:
- Virtualization is enabled for handling large data efficiently.
- Date Formatting:
TheformatSettingsproperty is used to apply custom date formats:formatSettings: [{ name: 'Date', type: 'date', format: 'dd/MM/yyyy-hh:mm a' }]
- Grouping and Sorting:
Grouping is applied onProductIDwith a range interval of 4. - Performance Optimization:
Virtual scrolling and member editor limits are enabled for large datasets.
- A modern browser (Chrome, Firefox, Edge)
- No build tools required; this is a pure HTML/JavaScript example.
- Clone the repository:
git clone https://github.com/SyncfusionExamples/date-formatting-pivot-table
- Open the sample:
- Navigate to the project folder.
- Open
Date_Formatting.HTMLin your browser.
Date_Formatting.HTMLβ Main sample file with Pivot Table configuration.styles/material.cssβ Syncfusion Material theme.scripts/ej2.min.jsβ Syncfusion JavaScript library.
For questions or feedback, visit the Syncfusion Support Portal or Community Forums.
This is a commercial product and requires a valid Syncfusion license.
View License Terms.