From 6f5d364c5f7c1f6ec725ed79d9c5bdeba9facd1c Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 10:13:40 -0700 Subject: [PATCH 01/12] test README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dcc456cd..5290b3b6f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -ComPAIR +ComPAIRR ========== [![Join the chat at https://gitter.im/ubc/acj-versus](https://badges.gitter.im/ubc/acj-versus.svg)](https://gitter.im/ubc/acj-versus?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) From b4e5bf9dd7160b75408650298211aa3458c20b59 Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 10:26:10 -0700 Subject: [PATCH 02/12] PlanReleaseDate: updated UTC display --- compair/api/assignment_search_enddate.py | 10 ++++++++-- compair/static/script-assignment-search.js | 13 +++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/compair/api/assignment_search_enddate.py b/compair/api/assignment_search_enddate.py index 4c3222b16..234efb75f 100644 --- a/compair/api/assignment_search_enddate.py +++ b/compair/api/assignment_search_enddate.py @@ -31,7 +31,7 @@ api = new_restful_api(assignment_search_enddate_api) ##event -on_assignment_get = event.signal('ASSIGNMENT_GET') +##on_assignment_get = event.signal('ASSIGNMENT_GET') def validate(date_text): try: @@ -48,7 +48,7 @@ def get(self): search_date_assignment_parser = RequestParser() search_date_assignment_parser.add_argument('compare_start', default=datetime.now().strftime("%Y-%m-%d")) search_date_assignment_parser.add_argument('compare_end', default=datetime.now().strftime("%Y-%m-%d")) - search_date_assignment_parser.add_argument('compare_localTimeZone', default='UTC') + search_date_assignment_parser.add_argument('compare_localTimeZone', default='America/Vancouver') args = search_date_assignment_parser.parse_args() @@ -76,7 +76,13 @@ def get(self): engine = create_engine(db_url, pool_size=5, pool_recycle=3600) conn = engine.connect() + print(compare_localTimeZone) + sql_text = str("SELECT JSON_OBJECT('course_name', t1.name,'name', t2.name,'answer_start', date_format(t2.answer_start, '%%M %%d, %%Y'),'answer_end', date_format(t2.answer_end, '%%M %%d, %%Y'),'compare_start', date_format(t2.compare_start, '%%M %%d, %%Y'), 'compare_end', date_format(t2.compare_end, '%%M %%d, %%Y'), 'self_eval_end', date_format(t2.self_eval_end, '%%M %%d, %%Y'), 'self_eval_start', date_format(t2.self_eval_start, '%%M %%d, %%Y')) FROM course as t1, assignment as t2 WHERE (t1.id = t2.course_id) AND (t2.active=TRUE AND t1.active=TRUE) AND (t2.compare_end >= '" + end_date + "' OR answer_end >= '" + end_date + "' OR self_eval_end >= '" + end_date + "');"); + sql_text = str("SELECT JSON_OBJECT('course_name', t1.name,'name', t2.name,'answer_start', date_format(CONVERT_TZ(t2.answer_start, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'),'answer_end', date_format(t2.answer_end, '%%M %%d, %%Y'),'compare_start', date_format(t2.compare_start, '%%M %%d, %%Y'), 'compare_end', date_format(t2.compare_end, '%%M %%d, %%Y'), 'self_eval_end', date_format(t2.self_eval_end, '%%M %%d, %%Y'), 'self_eval_start', date_format(t2.self_eval_start, '%%M %%d, %%Y')) FROM course as t1, assignment as t2 WHERE (t1.id = t2.course_id) AND (t2.active=TRUE AND t1.active=TRUE) AND (t2.compare_end >= '" + end_date + "' OR answer_end >= '" + end_date + "' OR self_eval_end >= '" + end_date + "');"); + sql_text = str("SELECT JSON_OBJECT('course_name', t1.name,'name', t2.name,'answer_start', date_format(CONVERT_TZ(t2.answer_start, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'),'answer_end', date_format(CONVERT_TZ(t2.answer_end, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'),'compare_start', date_format(CONVERT_TZ(t2.compare_start, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'), 'compare_end', date_format(CONVERT_TZ(t2.compare_end, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'), 'self_eval_end', date_format(CONVERT_TZ(t2.self_eval_end, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'), 'self_eval_start', date_format(CONVERT_TZ(t2.self_eval_start, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y')) FROM course as t1, assignment as t2 WHERE (t1.id = t2.course_id) AND (t2.active=TRUE AND t1.active=TRUE) AND (t2.compare_end >= '" + end_date + "' OR answer_end >= '" + end_date + "' OR self_eval_end >= '" + end_date + "');"); + sql_text = str("SELECT JSON_OBJECT('course_name', t1.name,'name', t2.name,'answer_start', date_format(CONVERT_TZ(t2.answer_start, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y'),'answer_end', date_format(CONVERT_TZ(t2.answer_end, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y'),'compare_start', date_format(CONVERT_TZ(t2.compare_start, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y'), 'compare_end', date_format(CONVERT_TZ(t2.compare_end, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y'), 'self_eval_end', date_format(CONVERT_TZ(t2.self_eval_end, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y'), 'self_eval_start', date_format(CONVERT_TZ(t2.self_eval_start, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y')) FROM course as t1, assignment as t2 WHERE (t1.id = t2.course_id) AND (t2.active=TRUE AND t1.active=TRUE) AND (t2.compare_end >= '" + end_date + "' OR answer_end >= '" + end_date + "' OR self_eval_end >= '" + end_date + "');"); + print(sql_text) result = conn.execute(sql_text) diff --git a/compair/static/script-assignment-search.js b/compair/static/script-assignment-search.js index 24b25be9d..06f1d1177 100644 --- a/compair/static/script-assignment-search.js +++ b/compair/static/script-assignment-search.js @@ -8,12 +8,25 @@ let diff = d.getTimezoneOffset(); let localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; function formatDate(date) { + console.log("FORMAT DATE::::" + date); + if (date.includes("Invalid Date")){ + console.log("FOUND:::" + date); + console.log("RETURN:::" + searchDay); + return searchDay; + } var d = (new Date(date.toString().replace(/-/g, '\/')) ); return d.toLocaleDateString('en-ca', options); } function getObjectDate(object) { + + if (object.includes("Invalid Date")){ + console.log("FOUND2:::" + object); + searchDay = new Date().toLocaleDateString('en-us', options); + console.log("RETURN2:::" + searchDay); + } + searchDay = formatDate(object); strURL = api_url.concat('?compare_end=').concat(object).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); From 4af37c8c0c081ab8277aaf4c67e5c3db77f0a8ea Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 13:45:40 -0700 Subject: [PATCH 03/12] PlanReleaseDate: test and clean code --- README.md | 2 +- compair/static/script-assignment-search.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5290b3b6f..2dcc456cd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -ComPAIRR +ComPAIR ========== [![Join the chat at https://gitter.im/ubc/acj-versus](https://badges.gitter.im/ubc/acj-versus.svg)](https://gitter.im/ubc/acj-versus?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) diff --git a/compair/static/script-assignment-search.js b/compair/static/script-assignment-search.js index 06f1d1177..81f9dc948 100644 --- a/compair/static/script-assignment-search.js +++ b/compair/static/script-assignment-search.js @@ -20,13 +20,13 @@ function formatDate(date) { function getObjectDate(object) { - +/* if (object.includes("Invalid Date")){ console.log("FOUND2:::" + object); searchDay = new Date().toLocaleDateString('en-us', options); console.log("RETURN2:::" + searchDay); } - +*/ searchDay = formatDate(object); strURL = api_url.concat('?compare_end=').concat(object).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); From 564c9c65436c4e771dd9152681a270f584081e75 Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 14:29:34 -0700 Subject: [PATCH 04/12] PlanReleaseDate: test and clean code --- compair/api/assignment_search_enddate.py | 9 --------- compair/static/script-assignment-search.js | 10 ---------- 2 files changed, 19 deletions(-) diff --git a/compair/api/assignment_search_enddate.py b/compair/api/assignment_search_enddate.py index 234efb75f..51bf3d5fe 100644 --- a/compair/api/assignment_search_enddate.py +++ b/compair/api/assignment_search_enddate.py @@ -30,9 +30,6 @@ assignment_search_enddate_api = Blueprint('assignment_search_enddate_api', __name__) api = new_restful_api(assignment_search_enddate_api) -##event -##on_assignment_get = event.signal('ASSIGNMENT_GET') - def validate(date_text): try: if date_text != datetime.strptime(date_text, "%Y-%m-%d").strftime('%Y-%m-%d'): @@ -76,13 +73,7 @@ def get(self): engine = create_engine(db_url, pool_size=5, pool_recycle=3600) conn = engine.connect() - print(compare_localTimeZone) - - sql_text = str("SELECT JSON_OBJECT('course_name', t1.name,'name', t2.name,'answer_start', date_format(t2.answer_start, '%%M %%d, %%Y'),'answer_end', date_format(t2.answer_end, '%%M %%d, %%Y'),'compare_start', date_format(t2.compare_start, '%%M %%d, %%Y'), 'compare_end', date_format(t2.compare_end, '%%M %%d, %%Y'), 'self_eval_end', date_format(t2.self_eval_end, '%%M %%d, %%Y'), 'self_eval_start', date_format(t2.self_eval_start, '%%M %%d, %%Y')) FROM course as t1, assignment as t2 WHERE (t1.id = t2.course_id) AND (t2.active=TRUE AND t1.active=TRUE) AND (t2.compare_end >= '" + end_date + "' OR answer_end >= '" + end_date + "' OR self_eval_end >= '" + end_date + "');"); - sql_text = str("SELECT JSON_OBJECT('course_name', t1.name,'name', t2.name,'answer_start', date_format(CONVERT_TZ(t2.answer_start, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'),'answer_end', date_format(t2.answer_end, '%%M %%d, %%Y'),'compare_start', date_format(t2.compare_start, '%%M %%d, %%Y'), 'compare_end', date_format(t2.compare_end, '%%M %%d, %%Y'), 'self_eval_end', date_format(t2.self_eval_end, '%%M %%d, %%Y'), 'self_eval_start', date_format(t2.self_eval_start, '%%M %%d, %%Y')) FROM course as t1, assignment as t2 WHERE (t1.id = t2.course_id) AND (t2.active=TRUE AND t1.active=TRUE) AND (t2.compare_end >= '" + end_date + "' OR answer_end >= '" + end_date + "' OR self_eval_end >= '" + end_date + "');"); - sql_text = str("SELECT JSON_OBJECT('course_name', t1.name,'name', t2.name,'answer_start', date_format(CONVERT_TZ(t2.answer_start, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'),'answer_end', date_format(CONVERT_TZ(t2.answer_end, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'),'compare_start', date_format(CONVERT_TZ(t2.compare_start, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'), 'compare_end', date_format(CONVERT_TZ(t2.compare_end, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'), 'self_eval_end', date_format(CONVERT_TZ(t2.self_eval_end, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y'), 'self_eval_start', date_format(CONVERT_TZ(t2.self_eval_start, 'UTC','" + compare_localTimeZone + "'), '%%M %%d, %%Y')) FROM course as t1, assignment as t2 WHERE (t1.id = t2.course_id) AND (t2.active=TRUE AND t1.active=TRUE) AND (t2.compare_end >= '" + end_date + "' OR answer_end >= '" + end_date + "' OR self_eval_end >= '" + end_date + "');"); sql_text = str("SELECT JSON_OBJECT('course_name', t1.name,'name', t2.name,'answer_start', date_format(CONVERT_TZ(t2.answer_start, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y'),'answer_end', date_format(CONVERT_TZ(t2.answer_end, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y'),'compare_start', date_format(CONVERT_TZ(t2.compare_start, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y'), 'compare_end', date_format(CONVERT_TZ(t2.compare_end, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y'), 'self_eval_end', date_format(CONVERT_TZ(t2.self_eval_end, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y'), 'self_eval_start', date_format(CONVERT_TZ(t2.self_eval_start, 'UTC','" + compare_localTimeZone + "'), '%%b %%d, %%Y')) FROM course as t1, assignment as t2 WHERE (t1.id = t2.course_id) AND (t2.active=TRUE AND t1.active=TRUE) AND (t2.compare_end >= '" + end_date + "' OR answer_end >= '" + end_date + "' OR self_eval_end >= '" + end_date + "');"); - print(sql_text) result = conn.execute(sql_text) diff --git a/compair/static/script-assignment-search.js b/compair/static/script-assignment-search.js index 81f9dc948..a0819d555 100644 --- a/compair/static/script-assignment-search.js +++ b/compair/static/script-assignment-search.js @@ -8,10 +8,7 @@ let diff = d.getTimezoneOffset(); let localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; function formatDate(date) { - console.log("FORMAT DATE::::" + date); if (date.includes("Invalid Date")){ - console.log("FOUND:::" + date); - console.log("RETURN:::" + searchDay); return searchDay; } var d = (new Date(date.toString().replace(/-/g, '\/')) ); @@ -20,13 +17,6 @@ function formatDate(date) { function getObjectDate(object) { -/* - if (object.includes("Invalid Date")){ - console.log("FOUND2:::" + object); - searchDay = new Date().toLocaleDateString('en-us', options); - console.log("RETURN2:::" + searchDay); - } -*/ searchDay = formatDate(object); strURL = api_url.concat('?compare_end=').concat(object).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); From 62fc63b963e9b4d323434a8937d8cd61f099a971 Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 15:09:49 -0700 Subject: [PATCH 05/12] PlanReleaseDate: test and clean code --- compair/static/script-assignment-search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compair/static/script-assignment-search.js b/compair/static/script-assignment-search.js index a0819d555..f822be6f9 100644 --- a/compair/static/script-assignment-search.js +++ b/compair/static/script-assignment-search.js @@ -18,7 +18,7 @@ function formatDate(date) { function getObjectDate(object) { searchDay = formatDate(object); - strURL = api_url.concat('?compare_end=').concat(object).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); + strURL = api_url.concat('?compare_end=').concat(searchDay).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); console.log(localTimeZone); From ff0a446d1d8a796aab15c0bf471dab429fc19da3 Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 15:33:29 -0700 Subject: [PATCH 06/12] PlanReleaseDate: test and clean code --- compair/static/script-assignment-search.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compair/static/script-assignment-search.js b/compair/static/script-assignment-search.js index f822be6f9..8ec7ae73b 100644 --- a/compair/static/script-assignment-search.js +++ b/compair/static/script-assignment-search.js @@ -17,7 +17,15 @@ function formatDate(date) { function getObjectDate(object) { - searchDay = formatDate(object); + + if (object.includes("Invalid Date")){ + console.log("FOUND2:::" + object); + searchDay = new Date().toLocaleDateString('en-us', options); + console.log("RETURN2:::" + searchDay); + }else{ + searchDay = formatDate(object); + } + strURL = api_url.concat('?compare_end=').concat(searchDay).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); console.log(localTimeZone); From 6790215fe3b3f1f763cee36320f987746b511ae7 Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 15:45:32 -0700 Subject: [PATCH 07/12] PlanReleaseDate: test and clean code --- compair/static/script-assignment-search.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compair/static/script-assignment-search.js b/compair/static/script-assignment-search.js index 8ec7ae73b..cf9a116e2 100644 --- a/compair/static/script-assignment-search.js +++ b/compair/static/script-assignment-search.js @@ -18,12 +18,11 @@ function formatDate(date) { function getObjectDate(object) { - if (object.includes("Invalid Date")){ + searchDay = formatDate(object); + if (searchDay.includes("Invalid Date")){ console.log("FOUND2:::" + object); searchDay = new Date().toLocaleDateString('en-us', options); console.log("RETURN2:::" + searchDay); - }else{ - searchDay = formatDate(object); } strURL = api_url.concat('?compare_end=').concat(searchDay).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); From 1217e4d9d7916b4a2fc5f586ff0cf044aff6b691 Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 15:53:38 -0700 Subject: [PATCH 08/12] PlanReleaseDate: test and clean code --- compair/static/script-assignment-search.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/compair/static/script-assignment-search.js b/compair/static/script-assignment-search.js index cf9a116e2..06f1d1177 100644 --- a/compair/static/script-assignment-search.js +++ b/compair/static/script-assignment-search.js @@ -8,7 +8,10 @@ let diff = d.getTimezoneOffset(); let localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; function formatDate(date) { + console.log("FORMAT DATE::::" + date); if (date.includes("Invalid Date")){ + console.log("FOUND:::" + date); + console.log("RETURN:::" + searchDay); return searchDay; } var d = (new Date(date.toString().replace(/-/g, '\/')) ); @@ -18,14 +21,14 @@ function formatDate(date) { function getObjectDate(object) { - searchDay = formatDate(object); - if (searchDay.includes("Invalid Date")){ + if (object.includes("Invalid Date")){ console.log("FOUND2:::" + object); searchDay = new Date().toLocaleDateString('en-us', options); console.log("RETURN2:::" + searchDay); } - strURL = api_url.concat('?compare_end=').concat(searchDay).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); + searchDay = formatDate(object); + strURL = api_url.concat('?compare_end=').concat(object).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); console.log(localTimeZone); From 5c5b606f772e26535da173970c5aa6b57ff12c67 Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 17:23:10 -0700 Subject: [PATCH 09/12] PlanReleaseDate: test and clean code --- compair/static/script-assignment-search.js | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/compair/static/script-assignment-search.js b/compair/static/script-assignment-search.js index 06f1d1177..27cb39eb0 100644 --- a/compair/static/script-assignment-search.js +++ b/compair/static/script-assignment-search.js @@ -7,6 +7,20 @@ const d = new Date(); let diff = d.getTimezoneOffset(); let localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; +function formatDateYYMMDD(date) { + var d = new Date(date), + month = '' + (d.getMonth() + 1), + day = '' + d.getDate(), + year = d.getFullYear(); + + if (month.length < 2) + month = '0' + month; + if (day.length < 2) + day = '0' + day; + + return [year, month, day].join('-'); +} + function formatDate(date) { console.log("FORMAT DATE::::" + date); if (date.includes("Invalid Date")){ @@ -15,20 +29,26 @@ function formatDate(date) { return searchDay; } var d = (new Date(date.toString().replace(/-/g, '\/')) ); + console.log("FORMATE DATE-varD2:::" + d.toLocaleDateString('en-ca', options) ); + return d.toLocaleDateString('en-ca', options); } function getObjectDate(object) { + console.log("OBJECT::::" + object); + + searchDay = formatDate(object); + console.log("OBJECT-searchDay:::" + formatDate2(searchDay)); + if (object.includes("Invalid Date")){ console.log("FOUND2:::" + object); searchDay = new Date().toLocaleDateString('en-us', options); console.log("RETURN2:::" + searchDay); } - searchDay = formatDate(object); - strURL = api_url.concat('?compare_end=').concat(object).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); + strURL = api_url.concat('?compare_end=').concat(formatDateYYMMDD(searchDay)).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); console.log(localTimeZone); From 4ed70e24eb5ae5fa196211c1801ba0913ed18220 Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 17:40:07 -0700 Subject: [PATCH 10/12] PlanReleaseDate: test and clean code --- compair/static/script-assignment-search.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compair/static/script-assignment-search.js b/compair/static/script-assignment-search.js index 27cb39eb0..c99521f9e 100644 --- a/compair/static/script-assignment-search.js +++ b/compair/static/script-assignment-search.js @@ -22,14 +22,14 @@ function formatDateYYMMDD(date) { } function formatDate(date) { - console.log("FORMAT DATE::::" + date); + //console.log("FORMAT DATE::::" + date); if (date.includes("Invalid Date")){ - console.log("FOUND:::" + date); - console.log("RETURN:::" + searchDay); + //console.log("FOUND:::" + date); + //console.log("RETURN:::" + searchDay); return searchDay; } var d = (new Date(date.toString().replace(/-/g, '\/')) ); - console.log("FORMATE DATE-varD2:::" + d.toLocaleDateString('en-ca', options) ); + //console.log("FORMATE DATE-varD2:::" + d.toLocaleDateString('en-ca', options) ); return d.toLocaleDateString('en-ca', options); } @@ -37,15 +37,15 @@ function formatDate(date) { function getObjectDate(object) { - console.log("OBJECT::::" + object); + //console.log("OBJECT::::" + object); searchDay = formatDate(object); - console.log("OBJECT-searchDay:::" + formatDate2(searchDay)); + //console.log("OBJECT-searchDay:::" + formatDate2(searchDay)); if (object.includes("Invalid Date")){ - console.log("FOUND2:::" + object); + //console.log("FOUND2:::" + object); searchDay = new Date().toLocaleDateString('en-us', options); - console.log("RETURN2:::" + searchDay); + //console.log("RETURN2:::" + searchDay); } strURL = api_url.concat('?compare_end=').concat(formatDateYYMMDD(searchDay)).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); From 51b4188441f2509f58e9043ab8cc22ea7bf92191 Mon Sep 17 00:00:00 2001 From: TueHoang Date: Wed, 29 Jun 2022 18:39:47 -0700 Subject: [PATCH 11/12] PlanReleaseDate: test and clean code --- compair/static/script-assignment-search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compair/static/script-assignment-search.js b/compair/static/script-assignment-search.js index c99521f9e..7da99a553 100644 --- a/compair/static/script-assignment-search.js +++ b/compair/static/script-assignment-search.js @@ -41,13 +41,13 @@ function getObjectDate(object) searchDay = formatDate(object); //console.log("OBJECT-searchDay:::" + formatDate2(searchDay)); - +/* if (object.includes("Invalid Date")){ //console.log("FOUND2:::" + object); searchDay = new Date().toLocaleDateString('en-us', options); //console.log("RETURN2:::" + searchDay); } - +*/ strURL = api_url.concat('?compare_end=').concat(formatDateYYMMDD(searchDay)).concat('&compare_localTimeZone=').concat(localTimeZone.toString()); console.log(localTimeZone); From af9c531f3b4807227465113d8ad9f51548542aad Mon Sep 17 00:00:00 2001 From: TueHoang Date: Thu, 30 Jun 2022 09:26:25 -0700 Subject: [PATCH 12/12] PlanReleaseDate: test and clean code --- .../assignment/assignment-search-partial.html | 2 +- compair/static/script-assignment-search.js | 23 ++++--------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/compair/static/modules/assignment/assignment-search-partial.html b/compair/static/modules/assignment/assignment-search-partial.html index e25b8d979..cd62d63ed 100644 --- a/compair/static/modules/assignment/assignment-search-partial.html +++ b/compair/static/modules/assignment/assignment-search-partial.html @@ -12,7 +12,7 @@

Plan Release Date

- +