How to use the dash-table/components/Table/props.ColumnType.Datetime function in dash-table

To help you get started, we’ve selected a few dash-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plotly / dash-table / demo / AppMode.ts View on Github external
(state.tableProps.columns || []).forEach(column => {
        if (column.id === 'ccc') {
            column.name = ['Date', 'only'];
            column.type = ColumnType.Datetime;
            column.validation = { allow_YY: true };
            (state.tableProps.data || []).forEach((row, i) => {
                const d = new Date(Date.UTC(2018, 0, 1));
                // three day increment
                d.setUTCDate(3 * i + 1);
                // date only
                row.ccc = d.toISOString().substr(0, 10);
            });
        } else if (column.id === 'ddd') {
            column.name = ['Date', 'with', 'time'];
            column.type = ColumnType.Datetime;
            (state.tableProps.data || []).forEach((row, i) => {
                const d = new Date(Date.UTC(2018, 0, 1));
                // two hours and 11 seconds increment
                d.setUTCSeconds(i * 7211);
                // datetime ending with seconds
github plotly / dash-table / src / dash-table / type / reconcile.ts View on Github external
function getValidator(c: Options): (value: any, c?: any) => IReconciliation {
    switch (c.type) {
        case ColumnType.Numeric:
            return validateNumber;
        case ColumnType.Text:
            return validateText;
        case ColumnType.Datetime:
            return validateDate;
        case ColumnType.Any:
        default:
            return reconcileAny;
    }
}
github plotly / dash-table / src / dash-table / syntax-tree / SingleColumnSyntaxTree.ts View on Github external
function getImplicitLexeme(type: ColumnType = ColumnType.Any): ILexemeResult {
    switch (type) {
        case ColumnType.Any:
        case ColumnType.Text:
            return {
                lexeme: boundLexeme(contains),
                value: RelationalOperator.Contains
            };
        case ColumnType.Datetime:
            return {
                lexeme: boundLexeme(dateStartsWith),
                value: RelationalOperator.DateStartsWith
            };
        case ColumnType.Numeric:
            return {
                lexeme: boundLexeme(equal),
                value: RelationalOperator.Equal
            };
    }
}