Skip to content

Commit

Permalink
Fix leading zero padding for JS dates before common era
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed May 23, 2021
1 parent 59f9df0 commit 9ab8244
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/rest-api",
"version": "3.4.1",
"version": "3.4.2",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"hebcal"
Expand Down Expand Up @@ -65,7 +65,7 @@
"eslint-config-google": "^0.14.0",
"jsdoc": "^3.6.7",
"jsdoc-to-markdown": "^5.0.3",
"rollup": "^2.48.0",
"rollup": "^2.49.0",
"rollup-plugin-terser": "^7.0.2"
}
}
2 changes: 1 addition & 1 deletion src/classic-rest-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ test('bce', (t) => {
const apiObj = eventToClassicApiObject(ev, options);
const expected = {
title: 'Erev Shavuot',
date: '-00001-05-06',
date: '-000001-05-06',
category: 'holiday',
subcat: 'major',
hebrew: 'ערב שבועות',
Expand Down
2 changes: 1 addition & 1 deletion src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function pad2(number) {
*/
export function pad4(number) {
if (number < 0) {
return '-0' + pad4(-number);
return '-00' + pad4(-number);
} else if (number < 10) {
return '000' + number;
} else if (number < 100) {
Expand Down
2 changes: 1 addition & 1 deletion src/fullcalendar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ test('bce', (t) => {
const fc = eventToFullCalendar(ev);
const expected = {
title: 'Erev Shavuot',
start: '-00001-05-06',
start: '-000001-05-06',
allDay: true,
className: 'holiday major',
hebrew: 'ערב שבועות',
Expand Down

0 comments on commit 9ab8244

Please sign in to comment.