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
|
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
|
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
|
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) {
|
function uixEarlierDate(date1, date2) {
|
||||||
// can this be done in a sane way?
|
// can this be done in a sane way?
|
||||||
// cuicui = 'year';
|
// cuicui = 'year';
|
||||||
|
if (date1 && date2) {
|
||||||
if (date1.getYear() < date2.getYear()) return date1;
|
if (date1.getYear() < date2.getYear()) return date1;
|
||||||
if (date1.getYear() > date2.getYear()) return date2;
|
if (date1.getYear() > date2.getYear()) return date2;
|
||||||
// same year
|
// same year
|
||||||
|
@ -34,45 +35,47 @@ function uixEarlierDate(date1, date2) {
|
||||||
// cuicui += '/date';
|
// cuicui += '/date';
|
||||||
if (date1.getDate() < date2.getDate()) return date1;
|
if (date1.getDate() < date2.getDate()) return date1;
|
||||||
if (date1.getDate() > date2.getDate()) return date2;
|
if (date1.getDate() > date2.getDate()) return date2;
|
||||||
|
}
|
||||||
// same day
|
// same day
|
||||||
return null;
|
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() {
|
function validateAptEditor() {
|
||||||
var e, startdate, enddate, tmpdate;
|
var e, startdate, enddate, tmpdate;
|
||||||
|
|
||||||
e = document.getElementById('summary');
|
e = document.getElementById('summary');
|
||||||
if (e.value.length == 0) {
|
if (e.value.length == 0
|
||||||
if (!confirm(labels.validate_notitle.decodeEntities()))
|
&& !confirm(labels.validate_notitle.decodeEntities()))
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
e = document.getElementById('startTime_date');
|
e = document.getElementById('startTime_date');
|
||||||
if (!e.disabled) {
|
if (!e.disabled) {
|
||||||
if (e.value.length != 10) {
|
startdate = validateDate(e, labels.validate_invalid_startdate);
|
||||||
alert(labels.validate_invalid_startdate.decodeEntities());
|
if (!startdate)
|
||||||
return false;
|
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');
|
e = document.getElementById('dueTime_date');
|
||||||
if (!e.disabled) {
|
if (!e.disabled) {
|
||||||
if (e.value.length != 10) {
|
enddate = validateDate(e, labels.validate_invalid_enddate);
|
||||||
alert(labels.validate_invalid_enddate.decodeEntities());
|
if (!enddate)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
enddate = e.calendar.prs_date(e.value);
|
|
||||||
if (enddate == null) {
|
if (startdate && enddate) {
|
||||||
alert(labels.validate_invalid_enddate.decodeEntities());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// cuicui = '';
|
|
||||||
tmpdate = uixEarlierDate(startdate, enddate);
|
tmpdate = uixEarlierDate(startdate, enddate);
|
||||||
if (tmpdate == enddate) {
|
if (tmpdate == enddate) {
|
||||||
// window.alert(cuicui);
|
// window.alert(cuicui);
|
||||||
|
@ -99,6 +102,7 @@ function validateAptEditor() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue