generate-google-calendar-link
v0.0.5
Published
Genelate a link to add a new event to the Google Calendar.
Downloads
919
Readme
generate-google-calendar-link
Genelate a link to add a new event to the Google Calendar.
Google Calendarに予定を追加するlinkを生成します。
This function will return a dom element.
DOM 要素を返します。
Usage
実行例
var a = generateLink({
start: new Date(2014, 10, 15, 10),
end: new Date(2014, 10, 15, 18),
title: 'New event',
location: 'Some where',
details: 'http://event.description.example.com/11234'
})
Parameters
See generate-google-calendar-url
Setup
For Node.js
インストール
npm install generate-google-calendar-link
実行例
var document = require('global/document')
var generateLink = require('generate-google-calendar-link')
var a = generateLink({
start: new Date(2014, 10, 15, 10),
end: new Date(2014, 10, 15, 18),
title: 'New event',
location: 'Some where',
details: 'http://event.description.example.com/11234'
})
document.getElementById('result').appendChild(a)
For browsers
Use browserify.
For example:
browserify example.js -o bundle.js
htmlにscriptタグを埋め込みます。
<span id="result"></span>
<script src="bundle.js"></script>
For bower
bower install generate-google-calendar-link
htmlにscriptタグを埋め込みます。
<link rel="stylesheet" href="bower_components/generate-google-calendar-link/index.css">
<div id="result"></div>
<script src="bower_components/generate-google-calendar-link/index.js"></script>
<script>
var a = generateLink({
start: new Date(2014, 10, 15, 10),
end: new Date(2014, 10, 15, 18),
title: 'New event',
location: 'Some where',
details: 'http://event.description.example.com/11234'
})
document.getElementById('result').appendChild(a)
</script>
Contributing
contributeするには
- Fork it.
- Create a branch (git checkout -b my_function)
- Commit your changes (git commit -am "Added My Function")
- Push to the branch (git push origin my_function)
- Open a Pull Request
- Enjoy a refreshing coffe and wait
Test
Standalone
mocha is used to test.
mochaを使います。
npm install
npm test
Deploy
npm
Update package.json
.
package.json
を更新します。
npm install
npm test
npm publish