Coder Social home page Coder Social logo

adamgibbons / ics Goto Github PK

View Code? Open in Web Editor NEW
706.0 13.0 152.0 1.05 MB

iCalendar (ics) file generator for node.js

License: ISC License

JavaScript 99.93% Ruby 0.07%
icalendar ical ics ics-ical javascript alarm calendar calendar-events vevent vcalendar

ics's Issues

handle line breaks in description

New lines need to be converted in the description. I used this hack to get a valid multiline description:

ics.buildEvent({
  // ...
  description: myDescriptionString.replace(/(?:\r\n|\r|\n)/g, '\\n'),
  // ...
}

Typescript

Hi
Thank you for your module
Please add typescript support.

Support for additional properties in calendar and event properties

Add the support for passing direct property params to an event or calendar. For add more possibilities of the standard: https://tools.ietf.org/html/rfc5545

For example:

var events = [
    {
        uid: '-UnitID-123456',
        title: 'Event 123456',
        created: '',// Not implemented yet
        start: [2018, 1, 15, 2, 30],
        end: [2018, 1, 17, 2, 30],
        description: 'Event description',
        additionals: [
           // For add in VEVENT: 'CREATED:20171019T171332Z'
           {
               attribute: 'CREATED',
               value: '20171019T171332Z'
           } 
    }
];
var properties = {
    productId: `-//Product//Unique-ID-1//EN`
};
ics.createCalendar(events, properties, callback);

Timezones

When event is being added to iCal, the TZ is GMT by default. How to work with Timezones?

start date isssue when convert from json to ical

{ ValidationError: child "start" fails because ["start" at position 2 fails because ["2" must be larger than or equal to 1]]
my json is :-
{
title: element.id.name,
start: [year, day, hour, minutes, seconds],
duration: { minutes: minutes }
}

Newlines in Location

Similar to #31, newlines in location need to be handled. Otherwise, only the first line ends up in the actual calendar entry.

Unsafe numbers on start

Sometimes, I get the following error:

{ ValidationError: child "start" fails because ["start" at position 4 fails because ["4" must be a safe number]]
    at Object.exports.process (c:\NodeInvitation\node_modules\joi\lib\errors.js:203:19)
    at _validateWithOptions (c:\NodeInvitation\node_modules\joi\lib\types\any\index.js:764:31)
    at internals.root.root.validate (c:\NodeInvitation\node_modules\joi\lib\index.js:147:23)
    at validateEvent (c:\NodeInvitation\node_modules\ics\dist\schema\index.js:76:37)
    at validateAndBuildEvent (c:\NodeInvitation\node_modules\ics\dist\index.js:22:38)
    at Object.createEvent (c:\NodeInvitation\node_modules\ics\dist\index.js:102:32)
    at c:\NodeInvitation\Routes\fleetinvite.js:1580:37
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:446:3)
  isJoi: true,
  name: 'ValidationError',
  details: 
   [ { message: '"4" must be a safe number',
       path: [Object],
       type: 'number.unsafe',
       context: [Object] } ],
  _object: 
   { title: 'Tyre appointment',
     productId: 'adamgibbons/ics',
     method: 'PUBLISH',
     uid: 'd65705ff-2236-4321-8a48-76621f378ba0',
     timestamp: '20190404T114200Z',
     start: [ '2019', '04', '20', '08', '00' ],
     description: 'Test',
     startType: 'local',
     duration: { minutes: 60 } },
  annotate: [Function] }

I initialize an event with the following parameters:

{
title: 'Tyre appointment',
description: appfunctions.attemptToStringify(data[0].FIS_Description),
startType: 'local',
start: [appointmentMoment.format('YYYY'), appointmentMoment.format('MM'), appointmentMoment.format('DD'), appointmentMoment.format('HH'),appointmentMoment.format('mm')],
duration: { minutes: 60 }
}

I have solved this by adding parseInt() in front of every moment value.

I thought it was curious why the error is only thrown sometimes.

Resetting the `ics` for new usage

Hey @adamgibbons thanks for the nice library!

I have a data structure with many people and many events for each people. My use case is to generate a .ics file for each person containing the events under them. Looking at your documentation I don't see a way to do that. What I want:

  1. Iterate through my data structure (each person) (first loop)
  2. For each person, iterate through their events (second loop)
  3. Create events (ics.createEvent)
  4. Exit second loop && write .ics file for that person
  5. Repeat for next person

But as of today's API, after each file write on step 4, it would only be appending to the same global ics variable, hence each file write would contain the events for all previous persons instead of only theirs.

Would it be possible to add another api to reset the ics var? Or make it possible to make ics an instance (var ics = new ICS())?

Thanks!!

Explain attribute "startType" (utc dates)

It took me quite a while to realize that i have to set the attribute startType to local in order to keep my UTC dates without conversion. It would be nice if the README would mention this feature

This library forces you to use files, correct?

Am I correct that this library forces you to write the data out to an ics file? I'm looking for something that just returns me a string or something and I can just stream it back to the user without having to write to a file.

example in README file will not validate

Just a quickie for a tiny documentation problem:

In your fourth example, 4. Create iCalendar events with Audio (Mac) you provide this code

let start = moment().format('YYYY-M-D').split("-")
let end = moment().add({'hours':2, "minutes":30}).format("YYYY-M-D").split("-")

You format the date using only year, month and date, but the duration is in hours and minutes. The ICS validator refuses this, for obvious reasons. :-)

Being more precise in the formatting solves the problem:

let start = moment().format('YYYY-M-D-H-m').split("-")
let end = moment().add({'hours':2, "minutes":30}).format("YYYY-M-D-H-m").split("-")

is this supported in safari??

I'm having problems getting safari to name the file and not save as "unknown". it does go to the downloads however when opened it's in text/edit. On download i do get an error of 'Failed to load resource: Frame load interrupted' in the browser console.

update dependencies to @hapi/joi

Hello,
any chance to update 'join' dependency to @hapi/joi?
Since:

This module has moved and is now available at @hapi/joi.

Thanks a lot
Ognian

Cherry pick methods from Lodash to reduce bundle size

It would be great if the lib cherry picks the lodash methods used to reduce bundle size.

Like:

// Cherry-pick methods for smaller browserify/rollup/webpack bundles.
const at = require('lodash/at');
const curryN = require('lodash/fp/curryN');

// OR
import at form 'lodash/at';
import curryN from 'lodash/fp/curryN';

instead of:

import _ from 'lodash';

Understanding default uid generation

Thanks for making this module.

Kind of new to Node.js. I'm trying to understand why the uuid's generated with uuid/v1 is the same for ICS files created around the same time. I'm wondering if this has something to do with how defaults is loaded?

For the life cycle of a node.js app, when is the uid in defaults actually generated? Seems the way defaults is using the uuid generator causes the uuid to be fixed for each time it is imported into buildEvent. An example quote from here:

> const before = { myProperty: uuid.v4() }
undefined
> before.myProperty
'bdf9794f-0897-48dd-8fed-da380dac6e74'

> const after = { myProperty: () => uuid.v4() }
undefined
> after.myProperty
[Function: myProperty]
> after.myProperty()
'40848bdb-7c04-40e2-8694-5513db705732'
> after.myProperty()
'd1edd511-6ce9-4a12-b196-4fafb6b3b16f'
> after.myProperty()
'1258559b-c082-436c-8ecb-f74679954ffd'
> // Etc ...

Timezone

How to use input time in particular timezone?
I can convert time to local timezone, but best way for me is to leave it in original timezone and use this for calendar

Why are ISO start times converted to iCal local time?

When I provide this library a start time in ISO format, the resulting iCal string has the start time as local time (Form #1 in the RFC, https://icalendar.org/iCalendar-RFC-5545/3-3-5-date-time.html). I would expect an absolute time to remain absolute in the resulting iCal string (Form #2). Specifically, what is the purpose of line 83 in lib/ics.js? How can I specify that the iCal string use form #2 when providing the start time in an absolute format?

Compatibility with Outlook and iOS

Hi,

I've started using this lib and it works great for Gmail. Email with ics attachment is recognized as meeting invite by Gmail, and special template for displaying meeting information is applied by Gmail.

Unfortunately, this does not happen when the same email with sam ics file is sent to [email protected] / iOS device. It's displayed as an ordinary email with an attachment. Polish popular email service poczta.wp.pl has the same problem.

What about MS Outlook? Will it recognize it or have same problem as Apple?

Organizer doesn't work

The organizer field was added in ade14c6, but doesn't seem to work anymore.

e.g., ran ex/app.js to create ics file by accessing /create endpoint. options for the new event includes:

organizer: {
            'name': 'greenpioneersolutions',
            email: '[email protected]'
        },

but outputted file does not contain the organizer:

BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:-//Adam Gibbons//agibbons.com//ICS: iCalendar Generator
BEGIN:VEVENT
UID:9427cc00-1335-11e7-bee7-5b486358a7d2
DTSTAMP:20170327T213729Z
DTSTART:20170327
DTEND:20170328
DESCRIPTION:Meet Down at the index.js
LOCATION:Fort Worth, Texas
ATTENDEE;CN=Support greenpioneersolutions:mailto:[email protected]
ATTENDEE;CN=no RSVP greenpioneersolutions:mailto:[email protected]
END:VEVENT
END:VCALENDAR

best practice for saving ICS files

It is said that files are saved in the "operating system's temporary directory". Was curious to know if you would recommend people to store these files elsewhere and how?
Thanks

Library converts UTC to server time

Please correct me if I'm wrong, but when you are doing this in set-date-with-utc-time.js

const formattedDate = moment([
      year,
      month - 1,
      date,
      hours,
      minutes,
      seconds
    ]).utc().format('YYYYMMDDTHHmm00') + 'Z'

you are calling moment([...])which will interpret the inputs as local. i.e., hours is the time on my watch in new york, not utc.

shouldn't it be moment.utc([...])... ?

Build task is not working

When installing the package from npm, the dist folder doesn't contain the latest changes. For example, in version 2.7.1 the change which let us customize the request attribute doesn't appear.

Module not found Error: Can't resolve 'dns'

Hello,

I am trying to use this library (many thanks by the way)

But as soon as I use the function ics.createEvent() I get a transpile error (see below)

Could you please help me overcome this.

Best regards.

ERROR in ./node_modules/isemail/lib/index.js
Module not found: Error: Can't resolve 'dns' in 'C:_dev\nsi\colibri\client\node_modules\isemail\lib'
resolve 'dns' in 'C:_dev\nsi\colibri\client\node_modules\isemail\lib'
Parsed request is a module
using description file: C:_dev\nsi\colibri\client\node_modules\isemail\package.json (relative path: ./lib)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\node_modules\isemail\package.json (relative path: ./lib)
resolve as module
C:_dev\nsi\colibri\client\node_modules\isemail\lib\node_modules doesn't exist or is not a directory
C:_dev\nsi\colibri\client\node_modules\isemail\node_modules doesn't exist or is not a directory
C:_dev\nsi\colibri\client\node_modules\node_modules doesn't exist or is not a directory
C:_dev\nsi\node_modules doesn't exist or is not a directory
C:_dev\node_modules doesn't exist or is not a directory
C:\node_modules doesn't exist or is not a directory
looking for modules in C:_dev\nsi\colibri\client\node_modules
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\node_modules\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\node_modules
using description file: C:_dev\nsi\colibri\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\package.json (relative path: ./node_modules)
using description file: C:_dev\nsi\colibri\package.json (relative path: ./node_modules/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\node_modules\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\node_modules\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\node_modules\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\node_modules\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\node_modules
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./node_modules/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\node_modules\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\node_modules\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
looking for modules in C:_dev\nsi\colibri\client\src
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src)
using description file: C:_dev\nsi\colibri\client\package.json (relative path: ./src/dns)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:_dev\nsi\colibri\client\src\dns.js doesn't exist
as directory
C:_dev\nsi\colibri\client\src\dns doesn't exist
[C:_dev\nsi\colibri\client\node_modules\isemail\lib\node_modules]
[C:_dev\nsi\colibri\client\node_modules\isemail\node_modules]
[C:_dev\nsi\colibri\client\node_modules\node_modules]
[C:_dev\nsi\node_modules]
[C:_dev\node_modules]
[C:\node_modules]
[C:_dev\nsi\colibri\client\node_modules\dns]
[C:_dev\nsi\colibri\node_modules\dns]
[C:_dev\nsi\colibri\client\node_modules\dns.ts]
[C:_dev\nsi\colibri\node_modules\dns.ts]
[C:_dev\nsi\colibri\client\node_modules\dns.js]
[C:_dev\nsi\colibri\node_modules\dns.js]
[C:_dev\nsi\colibri\client\node_modules\dns]
[C:_dev\nsi\colibri\node_modules\dns]
[C:_dev\nsi\colibri\client\node_modules\dns]
[C:_dev\nsi\colibri\client\node_modules\dns.ts]
[C:_dev\nsi\colibri\client\node_modules\dns.js]
[C:_dev\nsi\colibri\client\node_modules\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns]
[C:_dev\nsi\colibri\client\src\dns.ts]
[C:_dev\nsi\colibri\client\src\dns.js]
[C:_dev\nsi\colibri\client\src\dns]
@ ./node_modules/isemail/lib/index.js 5:12-26
@ ./node_modules/joi/lib/types/string/index.js
@ ./node_modules/joi/lib/index.js
@ ./node_modules/ics/dist/schema/index.js
@ ./node_modules/ics/dist/pipeline/validate.js
@ ./node_modules/ics/dist/pipeline/index.js
@ ./node_modules/ics/dist/index.js
@ ./node_modules/ics/index.js
@ ./src/app/shared/service/tools.service.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi ./src/main.ts

Time zone support messes up in version 2.13

When upgrading from version 2.12.1 to 2.13.0, all my events that are created in local time now jumps ahead two hours when are viewed in Apple Calendar og on Google Calendar. I'm currently in the GMT+2 time zone, so an event that was supposed to begin 9.15 now starts at 11.15.

Colons should not be escaped in TEXT property values

Great library. I noticed the \ was showing up in my descriptions in Calendar.app, so I did a little digging and found this in the RFC. I'll try to get a PR in this week, but I wanted to document it just in case I can't.

From the RFC:

However, a COLON character in a "TEXT" property value SHALL NOT be escaped with a BACKSLASH character.

Offending line: last .replace() in https://github.com/adamgibbons/ics/blob/master/src/utils/set-description.js#L2

Support for all day events

It's needed change the method for add start and end day for support all day events.
This is generating a DTSTART and DTEND in format YYYYMMDD without T000000Z, that is if the hour and second are no passed as param.

DIR or custom attributes not allowed within organizer/attendees

According to the spec, both organizer and attendee support DIR. Also, some calendar apps insert custom attributes (starting with X-).

However, ics fails when adding dir or any x-xxxx attribute. Example:

const ics = require('ics')

const event =
{
	start       : [ 2018, 5, 30, 6, 30 ],
	duration    : { hours: 6, minutes: 30 },
	title       : 'Bolder Boulder',
	description : 'Annual 10-kilometer run in Boulder, Colorado',
	location    : 'Bilbao',
	url         : 'https://meet.sync.work/qwe/asd?qwe=1234',
	organizer   :
	{
		name   : 'Manolo Foo',
		email  : '[email protected]',
		dir    : '1234-qwer-asdf',
		'x-id' : '1234-qwer-asdf'
	},
	attendees:
	[
		{
			name   : 'Adam Gibbons',
			email  : '[email protected]',
			dir    : '5678-rtty-dfgh',
			'x-id' : '5678-rtty-dfgh',
			rsvp   : true
		},
		{
			name   : 'Brittany Seaton',
			email  : '[email protected]',
			dir    : '9999-66666-tasd',
			'x-id' : '9999-66666-tasd'
		}
	]
};

ics.createEvent(event, (error, value) =>
{
	if (error)
	{
		console.error('ERROR:', error);

		return;
	}

	console.log(value);
});

It produces:

ERROR: { ValidationError: child "organizer" fails because ["dir" is not allowed, "x-id" is not allowed]
    at Object.exports.process (/private/tmp/node_modules/joi/lib/errors.js:181:19)
    at internals.Object._validateWithOptions (/private/tmp/node_modules/joi/lib/types/any/index.js:651:31)
    at module.exports.internals.Any.root.validate (/private/tmp/node_modules/joi/lib/index.js:121:23)
    at validateEvent (/private/tmp/node_modules/ics/dist/schema/index.js:72:37)
    at Object.createEvent (/private/tmp/node_modules/ics/dist/index.js:97:53)
    at Object.<anonymous> (/private/tmp/kk.js:36:5)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

END:VCALENDAR is missing

END:VCALENDAR is missing from output when providing only one event in an array.

possible patch :
if (value.indexOf('END:VCALENDAR') == -1)
value += 'END:VCALENDAR';

const ics = require('ics')

const { error, value } = ics.createEvents([
{
title: 'Lunch',
start: [2018, 1, 15, 12, 15],
end: [2018, 1, 15, 13, 15],
}
])

// BEGIN:VCALENDAR
// VERSION:2.0
// CALSCALE:GREGORIAN
// PRODID:adamgibbons/ics
// METHOD:PUBLISH
// X-PUBLISHED-TTL:PT1H
// BEGIN:VEVENT
// UID:016344bc-a3f4-4cbe-ab97-e1847d232b39
// SUMMARY:Lunch
// DTSTAMP:20180530T180600Z
// DTSTART:20180115T111500Z
// DTEND:20180115T121500Z
// END:VEVENT

.ics filename

Can you please tell me if it is possible to change the name of .ics filename and how.

Thanks for your work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.