Skip to content

Commit

Permalink
fix: get expiration date to show correctly on edit
Browse files Browse the repository at this point in the history
  • Loading branch information
alanzhu0 committed Oct 5, 2024
1 parent 3efd6f6 commit 81fb856
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions intranet/static/js/announcement.form.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ $(function() {
$(".exp-header").css("display", "none");
for (var i = 0; i < dates.length; i++) {
var use_date = dates[i].end ? dates[i].end.date() : dates[i].start.date();
$(".exp-list").append(`<li><a class='exp-suggest-item' data-date='${use_date}'>"${dates[i].text}" - ${use_date}</a></li>`);
var display_date = use_date.toDateString();
$(".exp-list").append(`<li><a class='exp-suggest-item' data-date='${use_date}'>"${dates[i].text}" - ${display_date}</a></li>`);
}
});

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

var exp = $("#id_expiration_date");

dateReset(exp);
if (exp.val() === "" || exp.val() === "3000-01-01 00:00:00") {
dateReset(exp);
}

$(".helptext", exp.parent()).before("<h5 style='display: none' class='exp-header'><b>Suggested Expiration Dates</b></h4><ul class='exp-list'></ul>");
$(".helptext", exp.parent()).before("<span class='exp-buttons'>" +
Expand Down
2 changes: 1 addition & 1 deletion intranet/templates/announcements/request.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h2>
<ol>
<li>Use correct English grammar, punctuation, and spelling.</li>
<li>Use formal language and tone; avoid slang, all caps, texting-style abbreviations, excessive use of bolding, underlining, emojis, etc.</li>
<li>Keep posts short and concise. Viewable dashboard space is limited on Ion; be considerate of other announcements. Avoid unecessary linebreaks or whitespace.</li>
<li>Keep posts short and concise. Viewable dashboard space is limited on Ion; be considerate of other announcements. Avoid unnecessary linebreaks or whitespace.</li>
<li>Do not submit repeat announcements; if an announcement about your topic has already been posted, do not request another.</li>
<li>See detailed guidelines <a target="_blank" href="https://guides.tjhsst.edu/ion/ion-announcement-guidelines">here</a>.</li>
</ol>
Expand Down

0 comments on commit 81fb856

Please sign in to comment.