Skip to content

Commit

Permalink
Use an unambiguous format for dates.
Browse files Browse the repository at this point in the history
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 monkbroc#5.
  • Loading branch information
timparenti committed Sep 2, 2019
1 parent adea5f4 commit 6b62fa6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/slack_time.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -233,7 +233,7 @@ function abbreviate(string) {
}

function formatSlackDate(dateMoment) {
return '_' + formatDayOfWeek(dateMoment) + ' ' + formatMonthDay(dateMoment) + '_ ';
return '_' + formatDayOfWeek(dateMoment) + ' ' + formatDayAndMonth(dateMoment) + '_ ';
}

function formatSlackTime(dateMoment) {
Expand Down

0 comments on commit 6b62fa6

Please sign in to comment.