fullcalendar/text/timeFormat.txt
2010-01-17 20:20:01 -08:00

44 lines
1.3 KiB
Text

timeFormat *1.1*
================
Determines the time-text that will be displayed on each event.
<div class='spec' markdown='1'>
String/[View Option Hash](../views/View_Option_Hash), *default*:
{
// for agendaWeek and agendaDay
agenda: 'h:mm{ - h:mm}', // 5:00 - 6:30
// for all other views
'': 'h(:mm)t' // 7p
}
</div>
A single format string will change the time-text for events in all views.
A [View Option Hash](../views/View_Option_Hash) may be provided to target specific views (this is what the default does).
Uses [formatDate](../utilities/formatDate)/[formatDates](../utilities/formatDates) formatting rules.
(The formatting rules were much different in versions before 1.3. [See here](../utilities/formatDate_pre_13))
Time-text will only be displayed for [Event Objects](../event_data/Event_Object) that have `allDay` equal to `false`.
Here is an example of displaying all events in a 24-hour format:
$('#calendar').fullCalendar({
events: [
{
title: 'My Event',
start: '2010-01-01T14:30:00',
allDay: false
}
// other events here...
],
timeFormat: 'H(:mm)' // uppercase H for 24-hour clock
});
<div class='version-info' markdown='1'>
A *View Option Hash* can only be provided in version 1.4 and later.
</div>