Skip to content

Commit

Permalink
Add test if convertPHPToMomentFormat returns correct format that cont…
Browse files Browse the repository at this point in the history
…ains escaped chars, like ES or DE needs
  • Loading branch information
carstingaxion committed May 3, 2024
1 parent 42166e7 commit 842570e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/unit/js/src/helpers/datetime.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,9 @@ test('convertPHPToMomentFormat returns correct time format', () => {

expect(format).toBe('h:mm a');
});

test('convertPHPToMomentFormat returns correct format that contains escaped chars, like ES or DE needs', () => {
const format = convertPHPToMomentFormat('G:i \\U\\h\\r'); // "20 Uhr" is german for "8 o'clock" (in the evening).

expect(format).toBe('H:mm \\U\\h\\r');
});

0 comments on commit 842570e

Please sign in to comment.