diff --git a/app/assets/javascripts/discourse/lib/formatter.js b/app/assets/javascripts/discourse/lib/formatter.js index c9b0fda1a..9303d63b9 100644 --- a/app/assets/javascripts/discourse/lib/formatter.js +++ b/app/assets/javascripts/discourse/lib/formatter.js @@ -96,7 +96,7 @@ Discourse.Formatter = (function(){ }; shortDateNoYear = function(date) { - return moment(date).shortDateNoYear(); + return moment(date).format(I18n.t("dates.tiny.date_month")); }; tinyDateYear = function(date) { @@ -261,7 +261,7 @@ Discourse.Formatter = (function(){ if ((new Date()).getFullYear() !== date.getFullYear()) { displayDate = shortDate(date); } else { - displayDate = moment(date).shortDateNoYear(); + displayDate = shortDateNoYear(date); } } else { displayDate = relativeAgeMediumSpan(distance, leaveAgo); diff --git a/config/locales/client.cs.yml b/config/locales/client.cs.yml index b5d108f28..62cb06131 100644 --- a/config/locales/client.cs.yml +++ b/config/locales/client.cs.yml @@ -59,7 +59,8 @@ cs: one: "1r" few: "%{count}r" other: "%{count}let" - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1 minuta" diff --git a/config/locales/client.da.yml b/config/locales/client.da.yml index 1f50a22f4..4423b7ec7 100644 --- a/config/locales/client.da.yml +++ b/config/locales/client.da.yml @@ -49,6 +49,8 @@ da: almost_x_years: one: "1å" other: "%{count}å" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1 min" diff --git a/config/locales/client.de.yml b/config/locales/client.de.yml index 29f91d27f..6a2f878cf 100644 --- a/config/locales/client.de.yml +++ b/config/locales/client.de.yml @@ -49,7 +49,8 @@ de: almost_x_years: one: "1J" other: "%{count}J" - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1 Minute" diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 8cd8eac1c..8ddc9b24f 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -49,7 +49,8 @@ en: almost_x_years: one: "1y" other: "%{count}y" - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1 min" diff --git a/config/locales/client.es.yml b/config/locales/client.es.yml index 2b6771bfe..8869a2f4d 100644 --- a/config/locales/client.es.yml +++ b/config/locales/client.es.yml @@ -51,7 +51,8 @@ es: almost_x_years: one: "1a" other: "%{count}a" - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1 minuto" diff --git a/config/locales/client.fr.yml b/config/locales/client.fr.yml index 93dbf3817..c5a009596 100644 --- a/config/locales/client.fr.yml +++ b/config/locales/client.fr.yml @@ -53,7 +53,8 @@ fr: almost_x_years: one: "1y" other: "%{count}a" - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1 min" diff --git a/config/locales/client.it.yml b/config/locales/client.it.yml index 893445c90..67108b04c 100644 --- a/config/locales/client.it.yml +++ b/config/locales/client.it.yml @@ -49,7 +49,8 @@ it: almost_x_years: one: "1a" other: "%{count}a" - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1 minuto" diff --git a/config/locales/client.ja.yml b/config/locales/client.ja.yml index 5554cb333..9ea4feb09 100644 --- a/config/locales/client.ja.yml +++ b/config/locales/client.ja.yml @@ -49,7 +49,8 @@ ja: almost_x_years: one: "1y" other: "%{count}y" - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1分" diff --git a/config/locales/client.ko.yml b/config/locales/client.ko.yml index c42ac814f..e945ea57f 100644 --- a/config/locales/client.ko.yml +++ b/config/locales/client.ko.yml @@ -50,6 +50,7 @@ ko: one: "거의 1년" other: "거의 %{count}년" date_year: "'YY M/D" + date_month: "MMM D" medium: x_minutes: one: "1분" diff --git a/config/locales/client.nl.yml b/config/locales/client.nl.yml index 213e11256..513689274 100644 --- a/config/locales/client.nl.yml +++ b/config/locales/client.nl.yml @@ -53,7 +53,8 @@ nl: almost_x_years: one: 1j other: "%{count}j" - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: 1 min diff --git a/config/locales/client.pseudo.yml b/config/locales/client.pseudo.yml index 758df67f2..9d1411cad 100644 --- a/config/locales/client.pseudo.yml +++ b/config/locales/client.pseudo.yml @@ -43,6 +43,8 @@ pseudo: almost_x_years: one: '[[ 1ý ]]' other: '[[ %{count}ý ]]' + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: '[[ 1 ɱíɳ ]]' diff --git a/config/locales/client.pt_BR.yml b/config/locales/client.pt_BR.yml index acd3ee20b..e7fb44885 100644 --- a/config/locales/client.pt_BR.yml +++ b/config/locales/client.pt_BR.yml @@ -49,7 +49,8 @@ pt_BR: almost_x_years: one: "1y" other: "%{count}y" - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1 minuto" diff --git a/config/locales/client.ru.yml b/config/locales/client.ru.yml index 4a5792fe8..a18b3b12d 100644 --- a/config/locales/client.ru.yml +++ b/config/locales/client.ru.yml @@ -72,7 +72,8 @@ ru: other: '%{count}лет' few: '%{count}лет' many: '%{count}лет' - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: '1 минута' diff --git a/config/locales/client.sv.yml b/config/locales/client.sv.yml index 0eab64512..0b2607592 100644 --- a/config/locales/client.sv.yml +++ b/config/locales/client.sv.yml @@ -49,7 +49,8 @@ sv: almost_x_years: one: "1y" other: "%{count}y" - date_year: "D MMM 'YY" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1 min" diff --git a/config/locales/client.zh_CN.yml b/config/locales/client.zh_CN.yml index a061d5a7b..0cc6afcf0 100644 --- a/config/locales/client.zh_CN.yml +++ b/config/locales/client.zh_CN.yml @@ -49,6 +49,7 @@ zh_CN: almost_x_years: one: "1年" other: "%{count}年" + date_month: "MMM-D" date_year: "YY-MM-D" medium: x_minutes: diff --git a/config/locales/client.zh_TW.yml b/config/locales/client.zh_TW.yml index 5fbc128e1..f4ce51dbb 100644 --- a/config/locales/client.zh_TW.yml +++ b/config/locales/client.zh_TW.yml @@ -49,6 +49,8 @@ zh_TW: almost_x_years: one: "1 年" other: "%{count} 年" + date_month: "MMM D" + date_year: "MMM 'YY" medium: x_minutes: one: "1 分鐘" diff --git a/test/javascripts/lib/formatter_test.js b/test/javascripts/lib/formatter_test.js index 531ea2280..c64d56713 100644 --- a/test/javascripts/lib/formatter_test.js +++ b/test/javascripts/lib/formatter_test.js @@ -29,7 +29,7 @@ var formatDays = function(days) { }; var shortDate = function(days){ - return moment().subtract('days', days).format('D MMM'); + return moment().subtract('days', days).format('MMM D'); }; test("formating medium length dates", function() { @@ -65,7 +65,7 @@ test("formating medium length dates", function() { equal(strip(formatDays(4.85)), "4 days"); equal(strip(formatDays(6)), shortDate(6)); - equal(strip(formatDays(100)), shortDate(100)); // eg: 23 Jan + equal(strip(formatDays(100)), shortDate(100)); // eg: Jan 23 equal(strip(formatDays(500)), shortDateYear(500)); equal($(formatDays(0)).attr("title"), moment().format('MMMM D, YYYY h:mma')); @@ -81,7 +81,7 @@ test("formating medium length dates", function() { test("formating tiny dates", function() { var shortDateYear = function(days){ - return moment().subtract('days', days).format("D MMM 'YY"); + return moment().subtract('days', days).format("MMM 'YY"); }; format = "tiny";