Skip to content

Commit 81fb856

Browse files
committed
fix: get expiration date to show correctly on edit
1 parent 3efd6f6 commit 81fb856

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

intranet/static/js/announcement.form.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ $(function() {
7171
$(".exp-header").css("display", "none");
7272
for (var i = 0; i < dates.length; i++) {
7373
var use_date = dates[i].end ? dates[i].end.date() : dates[i].start.date();
74-
$(".exp-list").append(`<li><a class='exp-suggest-item' data-date='${use_date}'>"${dates[i].text}" - ${use_date}</a></li>`);
74+
var display_date = use_date.toDateString();
75+
$(".exp-list").append(`<li><a class='exp-suggest-item' data-date='${use_date}'>"${dates[i].text}" - ${display_date}</a></li>`);
7576
}
7677
});
7778

@@ -100,13 +101,16 @@ $(function() {
100101
$(".exp-header").css("display", "none");
101102
for (var i = 0; i < dates.length; i++) {
102103
var use_date = dates[i].end ? dates[i].end.date() : dates[i].start.date();
103-
$(".exp-list").append(`<li><a class='exp-suggest-item' data-date='${use_date}'>"${dates[i].text}" - ${use_date}</a></li>`);
104+
var display_date = use_date.toDateString();
105+
$(".exp-list").append(`<li><a class='exp-suggest-item' data-date='${use_date}'>"${dates[i].text}" - ${display_date}</a></li>`);
104106
}
105107
});
106108

107109
var exp = $("#id_expiration_date");
108110

109-
dateReset(exp);
111+
if (exp.val() === "" || exp.val() === "3000-01-01 00:00:00") {
112+
dateReset(exp);
113+
}
110114

111115
$(".helptext", exp.parent()).before("<h5 style='display: none' class='exp-header'><b>Suggested Expiration Dates</b></h4><ul class='exp-list'></ul>");
112116
$(".helptext", exp.parent()).before("<span class='exp-buttons'>" +

intranet/templates/announcements/request.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ <h2>
6161
<ol>
6262
<li>Use correct English grammar, punctuation, and spelling.</li>
6363
<li>Use formal language and tone; avoid slang, all caps, texting-style abbreviations, excessive use of bolding, underlining, emojis, etc.</li>
64-
<li>Keep posts short and concise. Viewable dashboard space is limited on Ion; be considerate of other announcements. Avoid unecessary linebreaks or whitespace.</li>
64+
<li>Keep posts short and concise. Viewable dashboard space is limited on Ion; be considerate of other announcements. Avoid unnecessary linebreaks or whitespace.</li>
6565
<li>Do not submit repeat announcements; if an announcement about your topic has already been posted, do not request another.</li>
6666
<li>See detailed guidelines <a target="_blank" href="https://guides.tjhsst.edu/ion/ion-announcement-guidelines">here</a>.</li>
6767
</ol>

0 commit comments

Comments
 (0)