Topic list dates formatting changes: use Dec '12 and Jan 21

This commit is contained in:
Neil Lalonde 2014-01-29 15:45:06 -05:00
parent 946e837542
commit b5d0031105
18 changed files with 35 additions and 16 deletions

View file

@ -96,7 +96,7 @@ Discourse.Formatter = (function(){
}; };
shortDateNoYear = function(date) { shortDateNoYear = function(date) {
return moment(date).shortDateNoYear(); return moment(date).format(I18n.t("dates.tiny.date_month"));
}; };
tinyDateYear = function(date) { tinyDateYear = function(date) {
@ -261,7 +261,7 @@ Discourse.Formatter = (function(){
if ((new Date()).getFullYear() !== date.getFullYear()) { if ((new Date()).getFullYear() !== date.getFullYear()) {
displayDate = shortDate(date); displayDate = shortDate(date);
} else { } else {
displayDate = moment(date).shortDateNoYear(); displayDate = shortDateNoYear(date);
} }
} else { } else {
displayDate = relativeAgeMediumSpan(distance, leaveAgo); displayDate = relativeAgeMediumSpan(distance, leaveAgo);

View file

@ -59,7 +59,8 @@ cs:
one: "1r" one: "1r"
few: "%{count}r" few: "%{count}r"
other: "%{count}let" other: "%{count}let"
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1 minuta" one: "1 minuta"

View file

@ -49,6 +49,8 @@ da:
almost_x_years: almost_x_years:
one: "1å" one: "1å"
other: "%{count}å" other: "%{count}å"
date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1 min" one: "1 min"

View file

@ -49,7 +49,8 @@ de:
almost_x_years: almost_x_years:
one: "1J" one: "1J"
other: "%{count}J" other: "%{count}J"
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1 Minute" one: "1 Minute"

View file

@ -49,7 +49,8 @@ en:
almost_x_years: almost_x_years:
one: "1y" one: "1y"
other: "%{count}y" other: "%{count}y"
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1 min" one: "1 min"

View file

@ -51,7 +51,8 @@ es:
almost_x_years: almost_x_years:
one: "1a" one: "1a"
other: "%{count}a" other: "%{count}a"
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1 minuto" one: "1 minuto"

View file

@ -53,7 +53,8 @@ fr:
almost_x_years: almost_x_years:
one: "1y" one: "1y"
other: "%{count}a" other: "%{count}a"
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1 min" one: "1 min"

View file

@ -49,7 +49,8 @@ it:
almost_x_years: almost_x_years:
one: "1a" one: "1a"
other: "%{count}a" other: "%{count}a"
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1 minuto" one: "1 minuto"

View file

@ -49,7 +49,8 @@ ja:
almost_x_years: almost_x_years:
one: "1y" one: "1y"
other: "%{count}y" other: "%{count}y"
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1分" one: "1分"

View file

@ -50,6 +50,7 @@ ko:
one: "거의 1년" one: "거의 1년"
other: "거의 %{count}년" other: "거의 %{count}년"
date_year: "'YY M/D" date_year: "'YY M/D"
date_month: "MMM D"
medium: medium:
x_minutes: x_minutes:
one: "1분" one: "1분"

View file

@ -53,7 +53,8 @@ nl:
almost_x_years: almost_x_years:
one: 1j one: 1j
other: "%{count}j" other: "%{count}j"
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: 1 min one: 1 min

View file

@ -43,6 +43,8 @@ pseudo:
almost_x_years: almost_x_years:
one: '[[ 1ý ]]' one: '[[ 1ý ]]'
other: '[[ %{count}ý ]]' other: '[[ %{count}ý ]]'
date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: '[[ 1 ɱíɳ ]]' one: '[[ 1 ɱíɳ ]]'

View file

@ -49,7 +49,8 @@ pt_BR:
almost_x_years: almost_x_years:
one: "1y" one: "1y"
other: "%{count}y" other: "%{count}y"
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1 minuto" one: "1 minuto"

View file

@ -72,7 +72,8 @@ ru:
other: '%{count}лет' other: '%{count}лет'
few: '%{count}лет' few: '%{count}лет'
many: '%{count}лет' many: '%{count}лет'
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: '1 минута' one: '1 минута'

View file

@ -49,7 +49,8 @@ sv:
almost_x_years: almost_x_years:
one: "1y" one: "1y"
other: "%{count}y" other: "%{count}y"
date_year: "D MMM 'YY" date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1 min" one: "1 min"

View file

@ -49,6 +49,7 @@ zh_CN:
almost_x_years: almost_x_years:
one: "1年" one: "1年"
other: "%{count}年" other: "%{count}年"
date_month: "MMM-D"
date_year: "YY-MM-D" date_year: "YY-MM-D"
medium: medium:
x_minutes: x_minutes:

View file

@ -49,6 +49,8 @@ zh_TW:
almost_x_years: almost_x_years:
one: "1 年" one: "1 年"
other: "%{count} 年" other: "%{count} 年"
date_month: "MMM D"
date_year: "MMM 'YY"
medium: medium:
x_minutes: x_minutes:
one: "1 分鐘" one: "1 分鐘"

View file

@ -29,7 +29,7 @@ var formatDays = function(days) {
}; };
var shortDate = 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() { 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(4.85)), "4 days");
equal(strip(formatDays(6)), shortDate(6)); 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(strip(formatDays(500)), shortDateYear(500));
equal($(formatDays(0)).attr("title"), moment().format('MMMM D, YYYY h:mma')); 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() { test("formating tiny dates", function() {
var shortDateYear = function(days){ var shortDateYear = function(days){
return moment().subtract('days', days).format("D MMM 'YY"); return moment().subtract('days', days).format("MMM 'YY");
}; };
format = "tiny"; format = "tiny";