Skip to content

Commit

Permalink
Fix iCalendar fast start times
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Dec 7, 2020
1 parent d841e63 commit 9395767
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 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/icalendar",
"version": "2.8.0",
"version": "2.8.1",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"ical",
Expand All @@ -24,7 +24,7 @@
},
"dependencies": {
"@hebcal/core": "^2.7.0",
"@hebcal/rest-api": "^2.8.0",
"@hebcal/rest-api": "^2.8.1",
"md5": "^2.3.0"
},
"scripts": {
Expand Down Expand Up @@ -55,19 +55,19 @@
},
"devDependencies": {
"@ava/babel": "^1.0.1",
"@babel/core": "^7.12.8",
"@babel/core": "^7.12.9",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.12.7",
"@babel/register": "^7.12.1",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-babel": "^5.2.2",
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^10.0.0",
"ava": "^3.13.0",
"eslint": "^7.14.0",
"eslint": "^7.15.0",
"eslint-config-google": "^0.14.0",
"jsdoc": "^3.6.6",
"jsdoc-to-markdown": "^6.0.1",
"rollup": "^2.33.3"
"rollup": "^2.34.2"
}
}
3 changes: 0 additions & 3 deletions src/icalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ export function eventToIcal(e, options) {
let [hour, minute] = e.eventTimeStr.split(':');
hour = +hour;
minute = +minute;
if (hour < 12) {
hour += 12;
}
startDate += 'T' + pad2(hour) + pad2(minute) + '00';
endDate = startDate;
dtargs = `;TZID=${options.location.tzid}`;
Expand Down
7 changes: 7 additions & 0 deletions src/icalendar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,11 @@ test('fastStartEnd', (t) => {
'SUMMARY:Fast ends',
];
t.deepEqual(summary, expected);
const dtstart = icals.map((i) => i.split('\r\n').find((s) => s.startsWith('DTSTART')));
const expected2 = [
'DTSTART;TZID=America/New_York:20210627T031900',
'DTSTART;VALUE=DATE:20210627',
'DTSTART;TZID=America/New_York:20210627T210600',
];
t.deepEqual(dtstart, expected2);
});

0 comments on commit 9395767

Please sign in to comment.