import { formatDate } from './date-time';

describe('Date-Time Helper', () => {
  test('formatDate()', () => {
    expect(formatDate(null, 'YYYY')).toBeNull();
    expect(formatDate('2020-04-23 11:45:10', 'DD.MM.YY', '.', 'en-US')).toEqual('4.23.2020');
    expect(formatDate('2020-04-23 11:45:10', 'MMM YYYY', '/', 'en-US')).toEqual('April 2020');
    expect(formatDate('2020-04-23 11:45:10', 'DD/MM/YYYY', '@@', 'en-US')).toEqual('04@@23@@2020');
  });
});
