aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhuang-jinjie <pizza159630@gmail.com>2012-12-25 13:15:59 +0800
committerhuang-jinjie <pizza159630@gmail.com>2012-12-25 13:15:59 +0800
commit85c3da23b6c29c6e04650bca3090a8f0169313ea (patch)
tree816a137cb6b70f50c5595456105bf4f4f16e09c0
parentaf6d6fef6ad2ffec708b0efeab7c633312506fe3 (diff)
parent271440418a37b4f822158a6aa92d4a96d96b28ed (diff)
downloadinccalendar-85c3da23b6c29c6e04650bca3090a8f0169313ea.tar.gz
inccalendar-85c3da23b6c29c6e04650bca3090a8f0169313ea.tar.zst
inccalendar-85c3da23b6c29c6e04650bca3090a8f0169313ea.zip
Merge branch 'master' of ssh://linux5.csie.ntu.edu.tw/home/student/01/b01902062/projects/inccalender
-rw-r--r--js/caledit.js7
-rw-r--r--js/data.js7
2 files changed, 11 insertions, 3 deletions
diff --git a/js/caledit.js b/js/caledit.js
index 4fc738e..d699135 100644
--- a/js/caledit.js
+++ b/js/caledit.js
@@ -311,8 +311,11 @@ function caledit_validate(){
if(!isFinite(tmp) || tmp < 0 || tmp >= 60){
throw "請輸入正確的時間(分鐘)!";
}
- tmp = parseInt(remindobjw.value);
- if(!isFinite(tmp)){
+ tmp = remindobjw.value;
+ if(tmp == "NaN"){
+ tmp = "";
+ }
+ if(tmp != "" && !isFinite(parseInt(tmp))){
throw "請輸入正確的提醒時間!";
}
tmp = titleobjw.value;
diff --git a/js/data.js b/js/data.js
index 61a4abd..6a2fb6a 100644
--- a/js/data.js
+++ b/js/data.js
@@ -18,7 +18,9 @@ function CalEvent(){
return this.title == another.title &&
this.content == another.content &&
this.icon == another.icon &&
- this.remind == another.remind &&
+ (this.remind == another.remind ||
+ ((isNaN(this.remind) || this.remind == null) &&
+ (isNaN(another.remind) || another.remind == null))) &&
this.datafrom == another.datafrom &&
this.datetime.toString() == another.datetime.toString();
}
@@ -102,6 +104,9 @@ function inccal_fetch(year, month){
eventobj.content = XMLGetDataByTagName(calevent[i], "content");
eventobj.icon = parseInt(XMLGetDataByTagName(calevent[i], "icon"));
eventobj.remind = parseInt(XMLGetDataByTagName(calevent[i], "remind"));
+ if(!isFinite(eventobj.remind)){
+ eventobj.remind = null;
+ }
eventobj.datafrom = XMLGetDataByTagName(calevent[i], "datafrom");
eventobj.datetime = new Date();
eventobj.datetime.setFullYear(