mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Add NG3K DXpedition calendar #17
This commit is contained in:
@@ -27,7 +27,7 @@ function buildQueryString() {
|
||||
});
|
||||
str = str + "limit=" + $("#alerts-to-fetch option:selected").val();
|
||||
var maxDur = $("#max-duration option:selected").val();
|
||||
if (maxDur != "") {
|
||||
if (maxDur != "9999999999") {
|
||||
str = str + "&max_duration=" + maxDur;
|
||||
}
|
||||
return str;
|
||||
@@ -89,7 +89,8 @@ function addAlertRowsToTable(tbody, alerts) {
|
||||
var useLocalTime = $("#useLocalTime")[0].checked;
|
||||
|
||||
// Get times for the alert, and convert to local time if necessary.
|
||||
var start_time = moment.unix(a["start_time"]).utc();
|
||||
var start_time_unix = moment.unix(a["start_time"]);
|
||||
var start_time = start_time_unix.utc();
|
||||
if (useLocalTime) {
|
||||
start_time = start_time.local();
|
||||
}
|
||||
@@ -103,21 +104,27 @@ function addAlertRowsToTable(tbody, alerts) {
|
||||
// different year to the current year, in which case the year is inserted between month and hour.
|
||||
// If the time is set to local not UTC, and the date in local time is "today", we display that instead.
|
||||
// End time is displayed the same as above, except if the end date is the same as the start date, in which case
|
||||
// just e.g. 23:45 is used. Finally, if there is no end date set, "---" is displayed.
|
||||
var start_time_formatted = start_time.format("D MMM HH:mm");
|
||||
// just e.g. 23:45 is used.
|
||||
// Overriding all of that, if the start time is 00:00 and the end time is 23:59 when considered in UTC, the
|
||||
// hours and minutes are stripped out from the display, as we assume the server is just giving us full days.
|
||||
// Finally, if there is no end date set, "---" is displayed.
|
||||
var whole_days = start_time_unix.utc().format("HH:mm") == "00:00" &&
|
||||
(end_time_unix != null || end_time_unix > 0 || end_time_unix.utc().format("HH:mm") == "23:59");
|
||||
var hours_minutes_format = whole_days ? "" : " HH:mm";
|
||||
var start_time_formatted = start_time.format("D MMM" + hours_minutes_format);
|
||||
if (start_time.format("YYYY") != moment().format("YYYY")) {
|
||||
start_time_formatted = start_time.format("D MMM YYYY HH:mm");
|
||||
start_time_formatted = start_time.format("D MMM YYYY" + hours_minutes_format);
|
||||
} else if (useLocalTime && start_time.format("D MMM YYYY") == moment().format("D MMM YYYY")) {
|
||||
start_time_formatted = start_time.format("[Today] HH:mm");
|
||||
start_time_formatted = start_time.format("[Today]" + hours_minutes_format);
|
||||
}
|
||||
var end_time_formatted = "---";
|
||||
if (end_time_unix != null && end_time_unix > 0 && end_time != null) {
|
||||
var end_time_formatted = end_time.format("HH:mm");
|
||||
var end_time_formatted = whole_days ? start_time_formatted : end_time.format("HH:mm");
|
||||
if (end_time.format("D MMM") != start_time.format("D MMM")) {
|
||||
if (end_time.format("YYYY") != moment().format("YYYY")) {
|
||||
end_time_formatted = end_time.format("D MMM YYYY HH:mm");
|
||||
end_time_formatted = end_time.format("D MMM YYYY" + hours_minutes_format);
|
||||
} else {
|
||||
end_time_formatted = end_time.format("D MMM HH:mm");
|
||||
end_time_formatted = end_time.format("D MMM" + hours_minutes_format);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,7 +219,7 @@ function generateMaxDurationDropdownFilterCard(band_options) {
|
||||
<option value="86400" selected>24 hours</option>
|
||||
<option value="604800">1 week</option>
|
||||
<option value="2419200">4 weeks</option>
|
||||
<option value="">No limit</option>
|
||||
<option value="9999999999">No limit</option>
|
||||
</select>`);
|
||||
$p.append(" <i class='fa-solid fa-circle-question' title='Some users create long-duration alerts for the period they will be generally in and around xOTA references, not just the times they are specifically on the air. Use this control to restrict the maximum duration of spots that the software will display, and exclude any with a long duration.'></i>");
|
||||
// Compile HTML elements to return
|
||||
|
||||
Reference in New Issue
Block a user