From 591356239e557d41465be1c55c273084db13a573 Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Fri, 14 Dec 2018 13:57:55 -0500 Subject: [PATCH] titlecase short-forms --- changelog.md | 2 ++ src/methods/format/index.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 15e017e7..073db945 100644 --- a/changelog.md +++ b/changelog.md @@ -77,3 +77,5 @@ * uppercase month and day names in `.dayName()` * support city-names, `EST`, `PDT`, etc as input * set default `silent: true` to avoid unwanted logging +### 5.1.0 +* titlecase short-forms of months, days in `.format()` diff --git a/src/methods/format/index.js b/src/methods/format/index.js index 6c96ca33..bef7a8ab 100644 --- a/src/methods/format/index.js +++ b/src/methods/format/index.js @@ -6,7 +6,7 @@ const isoOffset = require('./_offset'); const format = { day: (s) => fns.titleCase(s.dayName()), - 'day-short': (s) => days.short()[s.day()], + 'day-short': (s) => fns.titleCase(days.short()[s.day()]), 'day-number': (s) => s.day(), 'day-ordinal': (s) => fns.ordinal(s.day()), 'day-pad': (s) => fns.zeroPad(s.day()), @@ -16,7 +16,7 @@ const format = { 'date-pad': s => fns.zeroPad(s.date()), month: (s) => fns.titleCase(s.monthName()), - 'month-short': (s) => months.short()[s.month()], + 'month-short': (s) => fns.titleCase(months.short()[s.month()]), 'month-number': (s) => s.month(), 'month-ordinal': (s) => fns.ordinal(s.month()), 'month-pad': (s) => fns.zeroPad(s.month()),