Genelate a link to add a new event to the Google Calendar.
Google Calendarに予定を追加するlinkを生成します。
This function will return a dom element.
DOM 要素を返します。
実行例
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'
})
See generate-google-calendar-url
インストール
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)
Use browserify.
For example:
browserify example.js -o bundle.js
htmlにscriptタグを埋め込みます。
<span id="result"></span>
<script src="bundle.js"></script>
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>
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
mocha is used to test.
mochaを使います。
npm install
npm test
Update package.json
.
package.json
を更新します。
npm install
npm test
npm publish