Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

calendarth

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calendarth - npm Package Compare versions

Comparing version 0.0.3 to 0.0.5

2

bower.json
{
"name": "calendarth",
"version": "0.0.3",
"version": "0.0.5",
"main": "./build/calendarth.min.js",

@@ -5,0 +5,0 @@ "ignore": [

{
"name": "calendarth",
"version": "0.0.3",
"version": "0.0.5",
"description": "Fetch a public Google Calendar using AJAX",

@@ -5,0 +5,0 @@ "main": "./src/",

@@ -55,4 +55,22 @@ # Calendarth

#### calendarth.getEventLink(eventItem)
Will return a url that can be used to add the event to a user's Google Calendar.
```js
cal.fetch(function(err, calendarObj) {
err === null; // true
// get the first event item
var eventItem = calendarObj.item.shift();
var addEventToCal = cal.getEventLink(eventItem);
console.log(addEventToCal);
});
```
## Release History
- **v0.0.5**, *12 Apr 2014*
- Add getEventLink() feature.
- **v0.0.3**, *9 Apr 2014*

@@ -59,0 +77,0 @@ - Published to NPM.

@@ -59,1 +59,23 @@ /*

};
/**
* Return a url that will perform the "Add Event to Google Calendar" action.
*
* @param {Object} eventItem The event data object.
* @return {string} The event link to use in the anchor element.
*/
Calendarth.prototype.getEventLink = function(eventItem) {
var out = 'http://www.google.com/calendar/event?action=TEMPLATE&text=';
out += encodeURIComponent(eventItem.summary);
out += '&dates=';
out += encodeURIComponent(eventItem.start.dateTime ?
eventItem.start.dateTime : eventItem.start.date);
out += '/';
out += encodeURIComponent(eventItem.end.dateTime ?
eventItem.end.dateTime : eventItem.end.date);
out += '&details=';
out += encodeURIComponent(eventItem.description);
out += '&location=';
out += encodeURIComponent(eventItem.location);
out += '&trp=false&sprop=name:';
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc