Monotone-Parent: bd6b8b8b6b9626985ced43786ab71d976da25933
Monotone-Revision: c3158529cb4ab65ea318a0f12e4853921d68d6ed Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-23T14:56:58 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
3913382a10
commit
262d341af3
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Copyright (C) 2005 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
This file is part of SOGo.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License as published by the
|
||||
|
@ -24,6 +24,7 @@ var contactSelectorAction = 'calendars-contacts';
|
|||
function uixEarlierDate(date1, date2) {
|
||||
// can this be done in a sane way?
|
||||
// cuicui = 'year';
|
||||
if (date1 && date2) {
|
||||
if (date1.getYear() < date2.getYear()) return date1;
|
||||
if (date1.getYear() > date2.getYear()) return date2;
|
||||
// same year
|
||||
|
@ -34,45 +35,47 @@ function uixEarlierDate(date1, date2) {
|
|||
// cuicui += '/date';
|
||||
if (date1.getDate() < date2.getDate()) return date1;
|
||||
if (date1.getDate() > date2.getDate()) return date2;
|
||||
}
|
||||
// same day
|
||||
return null;
|
||||
}
|
||||
|
||||
function validateDate(date, label) {
|
||||
var result, dateValue;
|
||||
|
||||
dateValue = date.calendar.prs_date(date.value);
|
||||
if (date.value.length != 10 || !dateValue) {
|
||||
alert(label.decodeEntities());
|
||||
result = false;
|
||||
} else
|
||||
result = dateValue;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function validateAptEditor() {
|
||||
var e, startdate, enddate, tmpdate;
|
||||
|
||||
e = document.getElementById('summary');
|
||||
if (e.value.length == 0) {
|
||||
if (!confirm(labels.validate_notitle.decodeEntities()))
|
||||
if (e.value.length == 0
|
||||
&& !confirm(labels.validate_notitle.decodeEntities()))
|
||||
return false;
|
||||
}
|
||||
|
||||
e = document.getElementById('startTime_date');
|
||||
if (!e.disabled) {
|
||||
if (e.value.length != 10) {
|
||||
alert(labels.validate_invalid_startdate.decodeEntities());
|
||||
startdate = validateDate(e, labels.validate_invalid_startdate);
|
||||
if (!startdate)
|
||||
return false;
|
||||
}
|
||||
startdate = e.calendar.prs_date(e.value);
|
||||
if (startdate == null) {
|
||||
alert(labels.validate_invalid_startdate.decodeEntities());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
e = document.getElementById('dueTime_date');
|
||||
if (!e.disabled) {
|
||||
if (e.value.length != 10) {
|
||||
alert(labels.validate_invalid_enddate.decodeEntities());
|
||||
enddate = validateDate(e, labels.validate_invalid_enddate);
|
||||
if (!enddate)
|
||||
return false;
|
||||
}
|
||||
enddate = e.calendar.prs_date(e.value);
|
||||
if (enddate == null) {
|
||||
alert(labels.validate_invalid_enddate.decodeEntities());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// cuicui = '';
|
||||
|
||||
if (startdate && enddate) {
|
||||
tmpdate = uixEarlierDate(startdate, enddate);
|
||||
if (tmpdate == enddate) {
|
||||
// window.alert(cuicui);
|
||||
|
@ -99,6 +102,7 @@ function validateAptEditor() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue