Skip to content

Commit

Permalink
Merge branch 'dev' into bugfix-blocks-geojson
Browse files Browse the repository at this point in the history
  • Loading branch information
mauberti-bc authored Dec 3, 2024
2 parents 37815fa + 82c8d9f commit 8dfe5aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/src/utils/datetime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import { combineDateTime, formatTimeDifference } from './datetime';
describe('combineDateTime', () => {
it('combines date and time into an ISO string', () => {
const result = combineDateTime('2024-01-01', '12:30:00');
expect(result).toEqual('2024-01-01T12:30:00.000Z');
expect(result).toEqual('2024-01-01T12:30:00');
});

it('combines date without time into an ISO string', () => {
const result = combineDateTime('2024-01-01');
expect(result).toEqual('2024-01-01T00:00:00.000Z');
expect(result).toEqual('2024-01-01T00:00:00');
});

it('returns ISO string for a different date and time', () => {
const result = combineDateTime('2023-12-31', '23:59:59');
expect(result).toEqual('2023-12-31T23:59:59.000Z');
expect(result).toEqual('2023-12-31T23:59:59');
});

it('handles invalid date formats gracefully', () => {
Expand Down
2 changes: 1 addition & 1 deletion app/src/utils/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import dayjs from 'dayjs';
import duration, { DurationUnitType } from 'dayjs/plugin/duration';
import { pluralize } from './Utils';

const TIMESTAMP_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSS[Z]';
const TIMESTAMP_FORMAT = 'YYYY-MM-DDTHH:mm:ss';

dayjs.extend(duration);

Expand Down

0 comments on commit 8dfe5aa

Please sign in to comment.