intl-relative-time-format
Version:
A fully spec-compliant polyfill for 'Intl.RelativeTimeFormat'
95 lines (94 loc) • 2.55 kB
JavaScript
if ("__addLocaleData" in Intl.RelativeTimeFormat) {
Intl.RelativeTimeFormat.__addLocaleData({
locale: "yo",
data: {
year: {
'0': 'ọ́dún yìí',
'1': 'ọ́dún tó ń bọ̀',
'-1': 'ọ́dún tó kọjá',
future: {
other: '+{0} y'
},
past: {
other: '-{0} y'
}
},
quarter: {
'0': 'this quarter',
'1': 'next quarter',
'-1': 'last quarter',
future: {
other: '+{0} Q'
},
past: {
other: '-{0} Q'
}
},
month: {
'0': 'oṣù yìí',
'1': 'óṣù tó ń bọ̀,',
'-1': 'óṣù tó kọjá',
future: {
other: '+{0} m'
},
past: {
other: '-{0} m'
}
},
week: {
'0': 'ọ̀sẹ̀ yìí',
'1': 'ọ́sẹ̀ tó ń bọ̀',
'-1': 'ọ̀sẹ̀ tó kọjá',
future: {
other: '+{0} w'
},
past: {
other: '-{0} w'
}
},
day: {
'0': 'Òní',
'1': 'Ọ̀la',
'2': 'òtúùnla',
'-2': 'íjẹta',
'-1': 'Àná',
future: {
other: '+{0} d'
},
past: {
other: '-{0} d'
}
},
hour: {
'0': 'this hour',
future: {
other: '+{0} h'
},
past: {
other: '-{0} h'
}
},
minute: {
'0': 'this minute',
future: {
other: '+{0} min'
},
past: {
other: '-{0} min'
}
},
second: {
'0': 'now',
future: {
other: '+{0} s'
},
past: {
other: '-{0} s'
}
},
nu: [
'latn'
]
}
});
}