00000000
Table of Contents
Video tutorial
Date columns in wpDataTables
“Date” columns are used to render the date values in the format you specify on the plugin settings page. If the content in the input data source cannot be cast as a date, PHP will reset the date to “01/01/1970” and this date will be rendered.
- Rendering rules: the value is set as a date, and then formatted using the format defined in the plugin settings.
- Sorting rules: date.
- Applicable filter types: date range.
- Issues to note:
- When working with Excel files, it’s the best to set the format of the Date columns as plain text; since the PHPSpreadsheet library that parses Excel files does not parse the Excel date format correctly, which results in an incorrect rendering of the dates (usually they get reset to 01/01/1970).
- When you’re working with MySQL, please cast timestamps, and datetime columns as dates only to avoid problems.
- Global search doesn’t support search by date.
Example of a table using date columns
“Date” column in this table is of date type.
Date column settings
If you created table using “Create a table linked to an existing data source” and the “Date” column is not rendered well (e.g., some cell values are missing) you have to choose the “Date input format” used in the provided data source. Our plugin guesses date formats correctly in most cases, but in cases where you have dates in string column in Excel, for example, you will need to “tell” our plugin which format to expect from your data source.
If you are creating a table using “Create a table by importing data from data source”, you should set “Date input format” before you create a table so that date values will be saved in the correct format in the database. You will see a “Date input format” dropdown in the column block that is a “Date” column type.
Read more
- Creating editable tables and filling the table data manually
- Creating non-editable tables from Excel files
- Creating non-editable tables from Google Spreadsheets
- String columns
- Integer columns
- Float columns
- Datetime columns
- Image columns
- URL link columns
- E-mail link columns
- Currency/price columns, and other columns with labels
- Formula (calculated) columns
- Coloring and styling columns
- Hiding columns