# All files / utils datetime.js

100% Statements 5/5
100% Branches 1/1
100% Functions 1/1
100% Lines 5/5

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    197x

    15x

    15x

    15x

    15x

     const formatDateTime = (date, format) => {
      let formatConfig;
      switch (format) {
        // TODO -> Add more format support
        default:
          formatConfig = {
            hour12: false,
            hour: '2-digit',
            minute: '2-digit',
          };
          break;
      }
      return new Intl.DateTimeFormat('es-ES', formatConfig).format(date);
    };

    export {
      formatDateTime,
    };