Skip to content

Instantly share code, notes, and snippets.

@pwim
Created Aug 22, 2013
Embed
What would you like to do?
<link rel='stylesheet' type='text/css' href='http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/1.6.3/fullcalendar.css' />
<script type='text/javascript' src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js'></script>
<script type='text/javascript' src='http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/1.6.3/fullcalendar.min.js'></script>
<script type="text/javascript">
$.ajax({
url: "http://api.doorkeeper.jp/groups/devlove/events.json",
dataType: "jsonp",
success: function (data) {
var events = jQuery.map(data, function(e){
return { title: e.event.title, start: new Date(e.event.starts_at), end: new Date(e.event.ends_at), url: e.event.public_url, allDay: false};
})
$(document).ready(function() {
$('#calendar').fullCalendar({
events: events,
header: {
left: 'prev,next today',
center: 'title',
right: 'month agendaWeek agendaDay'
},
firstDay: 1, // Start on Monday
// 24h formatting
axisFormat: 'HH:mm',
timeFormat: {
agenda: 'H:mm{ - H:mm}',
'': 'H:mm',
},
// Japanese localization
titleFormat: {
month: 'yyyy年M月',
week: "yyyy年M月d日{ ~ }{[yyyy年]}{[M月]d日}",
day: "yyyy年M月d日'('ddd')'"
},
buttonText: {
prev: '&lsaquo;',
next: '&rsaquo;',
prevYear: '&laquo;',
nextYear: '&raquo;',
today: '今日',
month: '月',
week: '週',
day: '日'
},
monthNames: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
dayNames: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'],
dayNamesShort: ['日', '月', '火', '水', '木', '金', '土'],
})
});
}
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment