From 6b62fa6d3efdf623083db120ab40bdc724b8ec83 Mon Sep 17 00:00:00 2001 From: Tim Parenti Date: Mon, 2 Sep 2019 15:20:37 -0400 Subject: [PATCH] Use an unambiguous format for dates. Use month abbreviations instead of numeric months, since day-of-week abbreviation is already locale-dependent anyway. Putting the day-of-month before the month abbreviation avoids the need for a comma after the day-of-week. Resolves #5. --- lib/slack_time.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/slack_time.js b/lib/slack_time.js index 7fef9e8..628cf30 100644 --- a/lib/slack_time.js +++ b/lib/slack_time.js @@ -212,8 +212,8 @@ function currentUserInfo(everybody, userId) { } } -function formatMonthDay(dateMoment) { - return dateMoment.format("MM-DD"); +function formatDayAndMonth(dateMoment) { + return dateMoment.format("D MMM"); } function formatDayOfWeek(dateMoment) { @@ -233,7 +233,7 @@ function abbreviate(string) { } function formatSlackDate(dateMoment) { - return '_' + formatDayOfWeek(dateMoment) + ' ' + formatMonthDay(dateMoment) + '_ '; + return '_' + formatDayOfWeek(dateMoment) + ' ' + formatDayAndMonth(dateMoment) + '_ '; } function formatSlackTime(dateMoment) {