Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comparisons between different dates formats #1380

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/pat/recurrence/recurrence.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,14 +690,15 @@ const RecurrenceInput = function (conf, textarea) {
function occurrenceAdd(event) {
event.preventDefault();
var datevalue = self.$modalForm.find(".riaddoccurrence input#adddate").val();
var date_parts = datevalue.split("-");
datevalue += datevalue.length === 10 ? "T000000" : "";
var errorarea = self.$modalForm.find(".riaddoccurrence div.alert");
errorarea.text("");
errorarea.hide();

// Add date only if it is not already in RDATE
if (!textarea["ical"].RDATE.includes(datevalue)) {
textarea["ical"].RDATE.push(datevalue);
var date_parts = datevalue.split("-");
var $newdate =
$(`<div class="d-flex justify-content-between occurrence rdate">
<span class="rdate">
Expand Down Expand Up @@ -772,6 +773,7 @@ const RecurrenceInput = function (conf, textarea) {
y = parseInt(date.substring(0, 4), 10);
m = parseInt(date.substring(4, 6), 10) - 1; // jan=0
d = parseInt(date.substring(6, 8), 10);
occurrence.date = `${y}-${zeropad(m+1)}-${zeropad(d)}T000000`;
occurrence.formattedDate = format(
new Date(y, m, d),
conf.localization.longDateFormat,
Expand Down
Loading