Skip to content

Commit

Permalink
French & Spanish ordinal changes - replace incorrect French ordinals …
Browse files Browse the repository at this point in the history
…with standard number + '.'.
  • Loading branch information
mjradwin committed Jan 24, 2021
1 parent 8a06ae5 commit a658a65
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/core",
"version": "3.1.0",
"version": "3.2.0",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"contributors": [
"Eyal Schachter (https://github.com/Scimonster)",
Expand Down Expand Up @@ -74,18 +74,18 @@
"@rollup/plugin-babel": "^5.2.2",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.0.1",
"@rollup/plugin-node-resolve": "^11.1.0",
"ava": "^3.15.0",
"core-js": "^3.8.2",
"eslint": "^7.17.0",
"core-js": "^3.8.3",
"eslint": "^7.18.0",
"eslint-config-google": "^0.14.0",
"gematriya": "^2.0.0",
"jsdoc": "^3.6.6",
"jsdoc-to-markdown": "^6.0.1",
"nyc": "^15.1.0",
"rollup": "^2.35.1",
"rollup": "^2.38.0",
"rollup-plugin-terser": "^7.0.2",
"tsd-jsdoc": "^2.5.0",
"ttag-cli": "^1.9.0"
"ttag-cli": "^1.9.1"
}
}
6 changes: 3 additions & 3 deletions src/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ export const Locale = {
*/
ordinal: function(n, locale) {
const locale0 = locale || activeName;
if (!locale0 || locale0 == 'en' || 'ashkenazi' == locale0.substring(0, 9)) {
if (!locale0 || locale0 === 'en' || 'ashkenazi' === locale0.substring(0, 9)) {
return getEnOrdinal(n);
} else if (locale0 == 'fr') {
return n == 1 ? (n + 'er') : (n + 'ème');
} else if (locale0 == 'es') {
return n + 'º';
} else {
return n + '.';
}
Expand Down
3 changes: 2 additions & 1 deletion src/locale.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ test('useLocale-ordinal', (t) => {
Locale.useLocale('');
t.is(Locale.ordinal(3), '3rd');

t.is(Locale.ordinal(3, 'fr'), '3ème');
t.is(Locale.ordinal(3, 'fr'), '3.');
t.is(Locale.ordinal(3, 'es'), '3º');
});

0 comments on commit a658a65

Please sign in to comment.