Skip to content

Commit

Permalink
Update future relative time for Italian
Browse files Browse the repository at this point in the history
  • Loading branch information
atscott committed Apr 27, 2020
1 parent 144e394 commit 8a610eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/locale/it.js
Expand Up @@ -39,9 +39,7 @@ export default moment.defineLocale('it', {
sameElse: 'L',
},
relativeTime: {
future: function (s) {
return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;
},
future : 'tra %s',
past: '%s fa',
s: 'alcuni secondi',
ss: '%d secondi',
Expand Down
6 changes: 3 additions & 3 deletions src/test/locale/it.js
Expand Up @@ -289,15 +289,15 @@ test('from', function (assert) {
});

test('suffix', function (assert) {
assert.equal(moment(30000).from(0), 'in alcuni secondi', 'prefix');
assert.equal(moment(30000).from(0), 'tra alcuni secondi', 'prefix');
assert.equal(moment(0).from(30000), 'alcuni secondi fa', 'suffix');
});

test('fromNow', function (assert) {
assert.equal(
moment().add({ s: 30 }).fromNow(),
'in alcuni secondi',
'in seconds'
'tra alcuni secondi',
'tra seconds'
);
assert.equal(moment().add({ d: 5 }).fromNow(), 'tra 5 giorni', 'in 5 days');
});
Expand Down

0 comments on commit 8a610eb

Please sign in to comment.