Date formatting per workspace member settings (#6408)
Implement date formatting per workspace member settings We'll need another round to maybe initialize all workspaces on the default settings. For now the default behavior is to take system settings if nothing is found in DB. --------- Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
describe('formatToHumanReadableMonth', () => {
|
||||
it('should format the date to a human-readable month', () => {
|
||||
const date = new Date('2022-01-01');
|
||||
const result = formatToHumanReadableMonth(date);
|
||||
const result = formatToHumanReadableMonth(date, 'UTC');
|
||||
expect(result).toBe('Jan');
|
||||
});
|
||||
});
|
||||
@@ -15,7 +15,7 @@ describe('formatToHumanReadableMonth', () => {
|
||||
describe('formatToHumanReadableDay', () => {
|
||||
it('should format the date to a human-readable day', () => {
|
||||
const date = new Date('2022-01-01');
|
||||
const result = formatToHumanReadableDay(date);
|
||||
const result = formatToHumanReadableDay(date, 'UTC');
|
||||
expect(result).toBe('1');
|
||||
});
|
||||
});
|
||||
@@ -23,7 +23,7 @@ describe('formatToHumanReadableDay', () => {
|
||||
describe('formatToHumanReadableTime', () => {
|
||||
it('should format the date to a human-readable time', () => {
|
||||
const date = new Date('2022-01-01T12:30:00');
|
||||
const result = formatToHumanReadableTime(date);
|
||||
const result = formatToHumanReadableTime(date, 'UTC');
|
||||
// it seems when running locally on MacOS the space is not the same
|
||||
expect(['12:30 PM', '12:30 PM']).toContain(result);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user