Checked in patches for bug 250307

This commit is contained in:
mostafah%oeone.com 2004-08-02 20:54:10 +00:00
Родитель 3fb034d97d
Коммит 6799fe378a
19 изменённых файлов: 75 добавлений и 107 удалений

Просмотреть файл

@ -489,17 +489,14 @@ DateFormater.prototype.formatInterval = function( startDateTime, endDateTime, is
: (sameDay
? (sameTime
// just one date time
? (this.getFormatedDate(startDateTime) +
" "+ this.getFormatedTime(startDateTime))
? this.formatDateTime(startDateTime)
// range of times on same day
: (this.getFormatedDate(startDateTime)+
" " + this.makeRange(this.getFormatedTime(startDateTime),
this.getFormatedTime(endDateTime))))
: this.formatDateTime(startDateTime, false,
this.makeRange(this.getFormatedTime(startDateTime),
this.getFormatedTime(endDateTime))))
// range across different days
: this.makeRange(this.getFormatedDate(startDateTime) +
" "+ this.getFormatedTime(startDateTime),
this.getFormatedDate(endDateTime) +
" "+ this.getFormatedTime(endDateTime))));
: this.makeRange(this.formatDateTime(startDateTime) +
this.formatDateTime(endDateTime))));
}
/** PRIVATE makeRange takes two strings and concatenates them with
@ -518,3 +515,37 @@ DateFormater.prototype.makeRange = function makeRange(fromString, toString) {
else
return fromString + " -- "+ toString;
}
/** PUBLIC formatDateTime formats both date and time from datetime in pref order.
If timeString is not null (such as "All Day"), it is used instead of time.
if omitDateIfToday is true, date is omitted if date is today.
If date is not today, date is more relevant than time, so default is
formatted DATE TIME so date is visible in columns too narrow to show both,
Override by setting preference calendar.date.formatTimeBeforeDate=true.
"DDD, DD MMM YYYY" "HH:mm"
Tue, 31 Dec 1999 21:00
Tue, 31 Dec 1999 All Day (called with "All Day" timeString)
Tue, 31 Dec 1999 21:00--22:00 (called by formatInterval with "21:00--22:00" timeString)
21:00 (called with datetime 21:00 today, with omitDateIfToday true, and no timeString)
All Day (called with datetime 0:00 today, with omitDateIfToday true, with timeString "All Day")
**/
DateFormater.prototype.formatDateTime = function formatDateTime(datetime, omitDateIfToday, timeString) {
var formattedTime = (timeString || this.getFormatedTime( datetime ));
if (omitDateIfToday) {
var today = new Date();
if (datetime.getFullYear() == today.getFullYear() &&
datetime.getMonth() == today.getMonth() &&
datetime.getDate() == today.getDate()) {
// if today, just show time (or "All day")
return formattedTime;
}
}
var formattedDate = this.getFormatedDate( datetime );
if ( getBoolPref(gCalendarWindow.calendarPreferences.calendarPref, "date.formatTimeBeforeDate", false )) {
return formattedTime+" "+formattedDate;
} else { // default
return formattedDate+" "+formattedTime;
}
}

Просмотреть файл

@ -219,25 +219,18 @@ function finishCalendarUnifinder( )
gICalLib.removeObserver( unifinderEventDataSourceObserver );
}
/**
* Helper function to display event dates in the unifinder
* Helper function to display event datetimes in the unifinder
*/
function formatUnifinderEventDate( date )
function formatUnifinderEventDateTime( datetime, isAllDay )
{
return( gCalendarWindow.dateFormater.getFormatedDate( date ) );
var allDayString = (isAllDay && gCalendarBundle.getString("AllDay"));
return gCalendarWindow.dateFormater.formatDateTime( datetime, true, allDayString );
}
/**
* Helper function to display event times in the unifinder
*/
function formatUnifinderEventTime( time )
{
return( gCalendarWindow.dateFormater.getFormatedTime( time ) );
}
/**
* This is attached to the ondblclik attribute of the events shown in the unifinder
@ -537,34 +530,18 @@ var treeView =
case "unifinder-search-results-tree-col-startdate":
var eventStartDate = getNextOrPreviousRecurrence( calendarEvent );
var startTime = formatUnifinderEventTime( eventStartDate );
var startDate = formatUnifinderEventDate( eventStartDate );
if( calendarEvent.allDay )
{
return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [startDate]));
}
else
{
return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [startDate, startTime]));
}
return formatUnifinderEventDateTime(eventStartDate, calendarEvent.allDay);
case "unifinder-search-results-tree-col-enddate":
var eventEndDate = getNextOrPreviousRecurrence( calendarEvent );
var eventLength = calendarEvent.end.getTime() - calendarEvent.start.getTime();
var actualEndDate = eventEndDate.getTime() + eventLength;
var endDate, endTime;
eventEndDate = new Date( actualEndDate );
if( calendarEvent.allDay ) {
if (calendarEvent.allDay) // display enddate is ical enddate - 1
//user-enddate is ical-enddate - 1
eventEndDate.setDate( eventEndDate.getDate() - 1 );
endDate = formatUnifinderEventDate( eventEndDate );
return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [endDate]));
} else {
endTime = formatUnifinderEventTime( eventEndDate );
endDate = formatUnifinderEventDate( eventEndDate );
return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [endDate, endTime]));
}
return formatUnifinderEventDateTime(eventEndDate, calendarEvent.allDay);
case "unifinder-search-results-tree-col-categories":
return( calendarEvent.categories );

Просмотреть файл

@ -121,6 +121,14 @@ function finishCalendarToDoUnifinder( )
gICalLib.removeTodoObserver( unifinderToDoDataSourceObserver );
}
/**
* Helper function to display todo datetimes in the unifinder
*/
function formatUnifinderToDoDateTime( datetime )
{
return gCalendarWindow.dateFormater.formatDateTime( datetime, true );
}
/**
* Called by event observers to update the display
@ -403,11 +411,11 @@ var toDoTreeView =
titleText = calendarToDo.title;
return( titleText );
case "unifinder-todo-tree-col-startdate":
return( formatUnifinderEventDate( new Date( calendarToDo.start.getTime() ) ) );
return( formatUnifinderToDoDateTime( new Date( calendarToDo.start.getTime() ) ) );
case "unifinder-todo-tree-col-duedate":
return( formatUnifinderEventDate( new Date( calendarToDo.due.getTime() ) ) );
return( formatUnifinderToDoDateTime( new Date( calendarToDo.due.getTime() ) ) );
case "unifinder-todo-tree-col-completeddate":
return( formatUnifinderEventDate( new Date( calendarToDo.completed.getTime() ) ) );
return( formatUnifinderToDoDateTime( new Date( calendarToDo.completed.getTime() ) ) );
case "unifinder-todo-tree-col-percentcomplete":
return( calendarToDo.percent+"%" );
case "unifinder-todo-tree-col-categories":

Просмотреть файл

@ -115,10 +115,7 @@ TooManyAlarmsMessage=M\u00E1te celkem %1$S upozorn\u011Bn\u00ED. Zobrazeno jich
1001=Upozorn\u011Bn\u00ED. UID nebyl nalezen! P\u0159i\u0159a\u010Fte nov\u00FD.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=Cel\u00FD den %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=Cel\u00FD den
eventUntitled=Nepojmenovan\u00FD
# Tooltips of events or todos

Просмотреть файл

@ -115,10 +115,7 @@ TooManyAlarmsMessage=Os oes gennych gyfanswm o %1$S larymau. Rydym wedi dangos y
1001=Rhybudd hegb ganfod UID\! Neulltuwch un newydd.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=Drwy'r Dydd %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=Drwy'r Dydd
eventUntitled=Dideitl
# Tooltips of events or todos

Просмотреть файл

@ -115,10 +115,7 @@ TooManyAlarmsMessage=Sie haben gesamt %1$S Alarme. Die letzten 6 wurden Ihnen an
1001=Warnung\! UID nicht gefunden\! Setze eine neue.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=Ganzt\u00E4gig %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=Ganzt\u00E4gig
eventUntitled=Ohne Titel
# Tooltips of events or todos

Просмотреть файл

@ -115,10 +115,7 @@ TooManyAlarmsMessage=You have %1$S total alarms. We've shown you the last 6. Cli
1001=Warning UID not found! Assigning new one.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=All day %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=All Day
eventUntitled=Untitled
# Tooltips of events or todos

Просмотреть файл

@ -114,10 +114,7 @@ TooManyAlarmsMessage=Tiene %1$S alarmas en total, de las cuales le mostramos las
1001=Aviso\: No se encontr\u00F3 el UID. Se asignar\u00E1 uno nuevo.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=Todo el d\u00EDa %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=Todo el d\u00EDa
eventUntitled=Sin t\u00EDtulo
# Tooltips of events or todos

Просмотреть файл

@ -115,10 +115,7 @@ TooManyAlarmsMessage=You have %1$S total alarms. We've shown you the last 6. Cli
1001=Avertissement UID non trouv\u00e9\u00a0! Un nouveau va \u00eatre assign\u00e9.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=All day %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=Toute la journée
eventUntitled=Untitled
# Tooltips of events or todos

Просмотреть файл

@ -117,10 +117,7 @@ TooManyAlarmsMessage=\u00d6sszesen %1$S \u00e9rtes\u00edt\u00e9se van, amib\u015
1001=Figyelmeztet\u00e9s: az UID nem tal\u00e1lhat\u00f3! \u00daj ker\u00fclt hozz\u00e1rendel\u00e9sre.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=Eg\u00e9sz napos %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
Allday=Eg\u00e9sz napos
eventUntitled=N\u00e9vtelen
# Tooltips of events or todos

Просмотреть файл

@ -118,10 +118,7 @@ TooManyAlarmsMessage=\u5408\u8a08 %1$S \u306e\u30a2\u30e9\u30fc\u30e0\u304c\u304
1001=\u4e0d\u660e UID \u8b66\u544a! \u65b0\u3057\u3044 UID \u3092\u5272\u308a\u5f53\u3066\u3066\u304f\u3060\u3055\u3044\u3002
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=%1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=\u7d42\u65e5
eventUntitled=\u30bf\u30a4\u30c8\u30eb\u306a\u3057
# Tooltips of events or todos

Просмотреть файл

@ -115,10 +115,7 @@ TooManyAlarmsMessage=I\u0161 viso turite %1$S signalus(-\u0173). Buvo parodyti t
1001=D\u0117mesio! UID nerastas. Priskirtas naujas.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=%1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=All Day
eventUntitled=Ne\u012fvardytas
# Tooltips of events or todos

Просмотреть файл

@ -115,10 +115,7 @@ TooManyAlarmsMessage=U heeft in totaal %1$S waarschuwingen. We hebben u de laats
1001=Waarschuwing UID niet gevonden! Bezig nieuwe toe te kennen.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=All day %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=All Day
eventUntitled=Untitled
# Tooltips of events or todos

Просмотреть файл

@ -114,10 +114,7 @@ TooManyAlarmsMessage=You have %1$S total alarms. We've shown you the last 6. Cli
1001=Uwaga nie znaleziono Identyfikatora Użytkownika! Przydziel nowy.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=All day %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=All day
eventUntitled=Niezatytułowane
# Tooltips of events or todos

Просмотреть файл

@ -116,10 +116,7 @@ TooManyAlarmsMessage=Voce tem %1$S alarme(s) no total. Nos mostramos a voce os u
1001=Aviso, UID nao encontrado! Criando novo.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=Dia Inteiro %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=Dia Inteiro
eventUntitled=Sem Titulo
# Tooltips of events or todos

Просмотреть файл

@ -115,10 +115,7 @@ TooManyAlarmsMessage=M\u00E1te celkom %1$S upozornen\u00ED. Zobrazen\u00E9 m\u00
1001=Upozornenie. UID nebol n\u00E1jden\u00FD! Prira\u010Fte nov\u00FD.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=Celodenn\u00E1 %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=Celodenn\u00E1
eventUntitled=Nepomenovan\u00FD
# Tooltips of events or todos

Просмотреть файл

@ -115,10 +115,7 @@ TooManyAlarmsMessage=Imate skupaj %1$S alarmov. Prikazanih je zadnjih \u0161est.
1001=Opozorilo\: ne najdem UID\! Dolo\u010Aam novega.
# Seznam dogodkov ali opravkov (unifinder)
## %1$S je dan
unifinderAlldayEventDate=Cel dan %1$S
## %1$S je dan, %2$S je \u010Das
unifinderNormalEventDate=%1$S %2$S
AllDay=Cel dan
eventUntitled=Neimenovan
# Tooltips of events or todos

Просмотреть файл

@ -116,10 +116,7 @@ TooManyAlarmsMessage=Du har %1$S alarm totalt. Du har visats de 6 senaste. Välj
1001=Warning UID not found! Assigning new one.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=Hela Dagen %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=Hela Dagen
eventUntitled=Namnlös
# Tooltips of events or todos

Просмотреть файл

@ -115,10 +115,7 @@ TooManyAlarmsMessage=Ma\u0107e %1$S alarmow w cy\u0142ku. Smy wam poslednje 6 po
1001=Warnowanje! UID njenamakane! P\u0159ipokazuju nowe.
# List of events or todos (unifinder)
## %1$S is the date
unifinderAlldayEventDate=Cy\u0142y d\u017ae\u0144 %1$S
## %1$S is the date, %2$S is the time
unifinderNormalEventDate=%1$S %2$S
AllDay=Cy\u0142y d\u017ae\u0144
eventUntitled=Bjez titla
# Tooltips of events or todos