diff --git a/src/Scripting/Postponer.ts b/src/Scripting/Postponer.ts index 3990842c42..9c6daa55ef 100644 --- a/src/Scripting/Postponer.ts +++ b/src/Scripting/Postponer.ts @@ -66,7 +66,7 @@ export function postponeMenuItemTitle(task: Task, amount: number, timeUnit: unit const updatedDateDisplayText = capitalizeFirstLetter(updatedDateType.replace('Date', '')); const postponedDate = new TasksDate(dateToUpdate).postpone(timeUnit, amount); - const formattedNewDate = postponedDate.format('ddd Do MMM, YYYY'); + const formattedNewDate = postponedDate.format('ddd Do MMM'); const amountOrArticle = amount > 1 ? amount : 'a'; return `${updatedDateDisplayText} in ${amountOrArticle} ${timeUnit}, on ${formattedNewDate}`; diff --git a/tests/Scripting/Postponer.test.ts b/tests/Scripting/Postponer.test.ts index d27d656cb6..4fbc3856c2 100644 --- a/tests/Scripting/Postponer.test.ts +++ b/tests/Scripting/Postponer.test.ts @@ -162,17 +162,17 @@ describe('postpone - UI text', () => { it('should include date type and new date in button tooltip', () => { const task = new TaskBuilder().dueDate(today).build(); expect(postponeButtonTitle(task, 1, 'day')).toEqual( - 'ℹ️ Due in a day, on Mon 4th Dec, 2023 (right-click for more options)', + 'ℹ️ Due in a day, on Mon 4th Dec (right-click for more options)', ); expect(postponeButtonTitle(task, 2, 'days')).toEqual( - 'ℹ️ Due in 2 days, on Tue 5th Dec, 2023 (right-click for more options)', + 'ℹ️ Due in 2 days, on Tue 5th Dec (right-click for more options)', ); }); it('should include date type and new date in context menu labels', () => { const task = new TaskBuilder().dueDate(today).build(); - expect(postponeMenuItemTitle(task, 1, 'day')).toEqual('Due in a day, on Mon 4th Dec, 2023'); - expect(postponeMenuItemTitle(task, 2, 'days')).toEqual('Due in 2 days, on Tue 5th Dec, 2023'); + expect(postponeMenuItemTitle(task, 1, 'day')).toEqual('Due in a day, on Mon 4th Dec'); + expect(postponeMenuItemTitle(task, 2, 'days')).toEqual('Due in 2 days, on Tue 5th Dec'); }); });