Date Columns
How to add a date column to your importer through code.
You can add a column to your importer directly through the UI of your Fuse account, or you can do so in code using the documentation below.
The Date column type validates that input is of a specific date format.
addColumn Function
The addColumn
function accepts an object as an argument.
internal_key
(String) - required: The internal key used to access a column’s value.label
(String) - required: The user-facing column label that is shown in the interface.column_type
(String) - required: Should be “date”.required
(String) - required: Whether or not the column is required.pattern
(String) - required: Must be one of these patterns.position
(Optional): The position or order of the column.unique
(Optional): Whether values should be unique.validations
(Optional): An array of built-in data validations. See Built-in Date Validations.transformations
(Optional): An array of built-in data transformations. See Built-in Date Transformations.
Example Code
Patterns
MM/dd/yyyy
Example: 08/31/2023; 12/15/2023
yyyy-MM-dd
Example: 2023-08-31; 2023-12-15
dd/MM/yyyy
Example: 31/08/2023; 15/12/2023
MM-dd-yyyy
Example: 08-31-2023; 12-15-2023
yyyy/MM/dd
Example: 2023/08/31; 2023/12/15
dd-MMMM-yyyy
Example: 31-August-2023; 15-December-2023
MMMM dd, yyyy
Example: August 31, 2023; December 15, 2023
dd/MM/yy
Example: 31/08/23; 15/12/23
MMMM dd, yy
Example: August 31, 23; December 15, 23
yy/MM/dd
Example: 23/08/31; 23/12/15
EEEE MMMM yyyy
Example: Tuesday August 2023; Thursday December 2023
EEEE dd MMMM yyyy
Example: Tuesday 08 August 2023; Thursday 15 December 2023
MM-dd-yy
Example: 01-15-90; 12-31-99
M-dd-yy
Example: 1-15-90; 12-31-99
dd-MM-yy
Example: 15-01-90; 31-12-99
dd-MM-yyyy
Example: 15-01-1990; 15-12-2023
dd-M-yy
Example: 15-1-90; 15-12-23
MM/dd/yy
Example: 01/15/90; 12/31/99
M/dd/yy
Example: 1/15/90; 12/31/99
MM.dd.yy
Example: 01.15.90; 12.31.99
M.dd.yy
Example: 1.15.90; 12.31.99
MMM-dd-yy
Example: Jan-15-90; Dec-31-99
MMMM-dd-yy
Example: January-15-90; December-31-99
dd-MMM-yy
Example: 15-Jan-90; 31-Dec-99
yyyy-M-dd
Example: 1990-1-15; 2023-12-31
M-dd-yyyy
Example: 1-15-1990; 12-31-2023
M/dd/yyyy
Example: 1/15/1990; 12/31/2023
dd/M/yyyy
Example: 15/1/1990; 31/12/2023
yyyy/M/dd
Example: 1990/1/15; 2023/12/31
dd.MM.yyyy
Example: 15.01.1990; 31.12.2023
dd.M.yyyy
Example: 15.1.1990; 31.12.2023
yyyy.MM.dd
Example: 1990.01.15; 2023.12.31
yyyy.M.dd
Example: 1990.1.15; 2023.12.31
MMM. dd, yyyy
Example: Jan. 15, 1990; Dec. 31, 2023
dd MMM. yyyy
Example: 15 Jan. 1990; 31 Dec. 2023
dd. MMM. yyyy
Example: 15. Jan. 1990; 31. Dec. 2023
EEE, MMM dd, yyyy
Example: Mon, Jan 15, 1990; Fri, Dec 31, 2023
Built-in Date Validations
The options property of addColumn
accepts an array of validations. Each validation has three properties:
validation_type:
the name of the validationmessage:
the message showed to the end user if the validation failsoptions:
options for the specific validation type
The validations property accepts an array of objects that contains these possible values: validation_type
, message
and options
. As the example below:
before_date
Specifies that the value must be before a certain date.
after_date
Specifies that the value must be after a certain date.
unique_case_sensitive
Specifies that the value must be unique using case-sensitive comparison.
unique_case_insensitive
Specifies that the value must be unique using case-insensitive comparison.
Built-in Date Transformations
The options property of addColumn
accepts an array of transformations. For the date transformations, you can specify one property:
transformation_type:
the name of the transformation
The transformations property accepts an array of objects that contains these possible values: transformation_type
. As the example below:
autoformat
The autoformat transformation automatically transforms the date in the column to a standardized format specified by the pattern
on the column.