From: Jørn Ølmheim Date: Sun, 17 Dec 2017 00:37:02 +0000 (+0100) Subject: [locale] es-us: Updated time format in accordance with CLDR and www.timeandunits... X-Git-Tag: 2.20.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98ff4d18630d2fb926447b487e66aaab79c404a8;p=thirdparty%2Fmoment.git [locale] es-us: Updated time format in accordance with CLDR and www.timeandunits.com (#4209) --- diff --git a/src/locale/es-us.js b/src/locale/es-us.js index c4e05cafe..9fa1460fe 100644 --- a/src/locale/es-us.js +++ b/src/locale/es-us.js @@ -24,12 +24,12 @@ export default moment.defineLocale('es-us', { weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), weekdaysParseExact : true, longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', + LT : 'h:mm A', + LTS : 'h:mm:ss A', L : 'MM/DD/YYYY', LL : 'MMMM [de] D [de] YYYY', - LLL : 'MMMM [de] D [de] YYYY H:mm', - LLLL : 'dddd, MMMM [de] D [de] YYYY H:mm' + LLL : 'MMMM [de] D [de] YYYY h:mm A', + LLLL : 'dddd, MMMM [de] D [de] YYYY h:mm A' }, calendar : { sameDay : function () { diff --git a/src/test/locale/es-us.js b/src/test/locale/es-us.js index 3795397d8..cf9056bc1 100644 --- a/src/test/locale/es-us.js +++ b/src/test/locale/es-us.js @@ -37,15 +37,16 @@ test('format', function (assert) { ['s ss', '50 50'], ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45º day of the year'], - ['LTS', '15:25:50'], + ['LT', '3:25 PM'], + ['LTS', '3:25:50 PM'], ['L', '02/14/2010'], ['LL', 'febrero de 14 de 2010'], - ['LLL', 'febrero de 14 de 2010 15:25'], - ['LLLL', 'domingo, febrero de 14 de 2010 15:25'], + ['LLL', 'febrero de 14 de 2010 3:25 PM'], + ['LLLL', 'domingo, febrero de 14 de 2010 3:25 PM'], ['l', '2/14/2010'], ['ll', 'feb. de 14 de 2010'], - ['lll', 'feb. de 14 de 2010 15:25'], - ['llll', 'dom., feb. de 14 de 2010 15:25'] + ['lll', 'feb. de 14 de 2010 3:25 PM'], + ['llll', 'dom., feb. de 14 de 2010 3:25 PM'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -159,13 +160,13 @@ test('fromNow', function (assert) { test('calendar day', function (assert) { var a = moment().hours(12).minutes(0).seconds(0); - assert.equal(moment(a).calendar(), 'hoy a las 12:00', 'today at the same time'); - assert.equal(moment(a).add({m: 25}).calendar(), 'hoy a las 12:25', 'Now plus 25 min'); - assert.equal(moment(a).add({h: 1}).calendar(), 'hoy a las 13:00', 'Now plus 1 hour'); - assert.equal(moment(a).add({d: 1}).calendar(), 'mañana a las 12:00', 'tomorrow at the same time'); - assert.equal(moment(a).add({d: 1, h : -1}).calendar(), 'mañana a las 11:00', 'tomorrow minus 1 hour'); - assert.equal(moment(a).subtract({h: 1}).calendar(), 'hoy a las 11:00', 'Now minus 1 hour'); - assert.equal(moment(a).subtract({d: 1}).calendar(), 'ayer a las 12:00', 'yesterday at the same time'); + assert.equal(moment(a).calendar(), 'hoy a las 12:00 PM', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'hoy a las 12:25 PM', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 1}).calendar(), 'hoy a las 1:00 PM', 'Now plus 1 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'mañana a las 12:00 PM', 'tomorrow at the same time'); + assert.equal(moment(a).add({d: 1, h : -1}).calendar(), 'mañana a las 11:00 AM', 'tomorrow minus 1 hour'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'hoy a las 11:00 AM', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'ayer a las 12:00 PM', 'yesterday at the same time'); }); test('calendar next week', function (assert) { @@ -216,4 +217,3 @@ test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2º', 'Jan 14 2012 should be week 2'); assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3º', 'Jan 15 2012 should be week 3'); }); -