Remove duplicated code
This commit is contained in:
parent
0c74b531c2
commit
c555e6bc42
1 changed files with 3 additions and 18 deletions
|
@ -69,9 +69,10 @@ function rcube_calendar_ui(settings)
|
||||||
|
|
||||||
|
|
||||||
/*** private methods ***/
|
/*** private methods ***/
|
||||||
|
|
||||||
var Q = this.quote_html;
|
var Q = this.quote_html;
|
||||||
|
var event_date_text = this.event_date_text;
|
||||||
|
|
||||||
var text2html = function(str, maxlen, maxlines)
|
var text2html = function(str, maxlen, maxlines)
|
||||||
{
|
{
|
||||||
var html = Q(String(str));
|
var html = Q(String(str));
|
||||||
|
@ -246,22 +247,6 @@ function rcube_calendar_ui(settings)
|
||||||
return is_attendee(event, 'ORGANIZER') || !event.id;
|
return is_attendee(event, 'ORGANIZER') || !event.id;
|
||||||
};
|
};
|
||||||
|
|
||||||
// create a nice human-readable string for the date/time range
|
|
||||||
var event_date_text = function(event)
|
|
||||||
{
|
|
||||||
var fromto, duration = event.end.getTime() / 1000 - event.start.getTime() / 1000;
|
|
||||||
if (event.allDay)
|
|
||||||
fromto = $.fullCalendar.formatDate(event.start, settings['date_format']) + (duration > 86400 || event.start.getDay() != event.end.getDay() ? ' — ' + $.fullCalendar.formatDate(event.end, settings['date_format']) : '');
|
|
||||||
else if (duration < 86400 && event.start.getDay() == event.end.getDay())
|
|
||||||
fromto = $.fullCalendar.formatDate(event.start, settings['date_format']) + ' ' + $.fullCalendar.formatDate(event.start, settings['time_format']) + ' — '
|
|
||||||
+ $.fullCalendar.formatDate(event.end, settings['time_format']);
|
|
||||||
else
|
|
||||||
fromto = $.fullCalendar.formatDate(event.start, settings['date_format']) + ' ' + $.fullCalendar.formatDate(event.start, settings['time_format']) + ' — '
|
|
||||||
+ $.fullCalendar.formatDate(event.end, settings['date_format']) + ' ' + $.fullCalendar.formatDate(event.end, settings['time_format']);
|
|
||||||
|
|
||||||
return fromto;
|
|
||||||
};
|
|
||||||
|
|
||||||
var load_attachment = function(event, att)
|
var load_attachment = function(event, att)
|
||||||
{
|
{
|
||||||
var qstring = '_id='+urlencode(att.id)+'&_event='+urlencode(event.recurrence_id||event.id)+'&_cal='+urlencode(event.calendar);
|
var qstring = '_id='+urlencode(att.id)+'&_event='+urlencode(event.recurrence_id||event.id)+'&_cal='+urlencode(event.calendar);
|
||||||
|
|
Loading…
Add table
Reference in a new issue