Skip to content

Formatting date and time #478

@ipflowss

Description

@ipflowss

Hi there,

Ive seen how to format date but how do I format time with date. Here is my code for formatting date only

      formatter: (cell) => {
        let dateObj = cell;
        if (typeof cell !== 'object') {
          dateObj = new Date(cell);
        }
        if (cell == null) {
          return
        }
        return `${('0' + (dateObj.getMonth() + 1)).slice(-2)}/${('0' + dateObj.getDate()).slice(-2)}/${dateObj.getFullYear()}`;
      },
      editor: {
        type: Type.DATE
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions