-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
setting Default Time that the Assignment is Due leads to an error #2572
Comments
I can confirm the issue here and the following fixes it for me. diff --git a/lib/WeBWorK/Utils/DateTime.pm b/lib/WeBWorK/Utils/DateTime.pm
index f1e13977f..3b055f917 100644
--- a/lib/WeBWorK/Utils/DateTime.pm
+++ b/lib/WeBWorK/Utils/DateTime.pm
@@ -59,7 +59,7 @@ sub getDefaultSetDueDate ($ce) {
my ($hour, $minute, $ampm) = $ce->{pg}{timeAssignDue} =~ m/\s*(\d+)\s*:\s*(\d+)\s*(am|pm|AM|PM)?\s*/;
$hour //= 0;
$minute //= 0;
- $hour += 12 if $ampm && $ampm =~ m/pm|PM/;
+ $hour += 12 if $ampm && $ampm =~ m/pm|PM/ && $hour != 12;
+ $hour = 0 if $ampm && $ampm =~ m/am|AM/ && $hour == 12;
my $dt = DateTime->from_epoch(epoch => time + 2 * 60 * 60 * 24 * 7); |
somiaj
added a commit
to somiaj/webwork2
that referenced
this issue
Sep 18, 2024
The logic to convert to 24 hour time didn't consider 12am and 12pm correctly, this fixes that. This fixes issue openwebwork#2572
somiaj
added a commit
to somiaj/webwork2
that referenced
this issue
Sep 18, 2024
The logic to convert to 24 hour time didn't consider 12am and 12pm correctly, this fixes that. This fixes issue openwebwork#2572
somiaj
added a commit
to somiaj/webwork2
that referenced
this issue
Sep 19, 2024
The logic to convert to 24 hour time didn't consider 12am and 12pm correctly, this fixes that. This fixes issue openwebwork#2572
somiaj
added a commit
to somiaj/webwork2
that referenced
this issue
Sep 19, 2024
The logic to convert to 24 hour time didn't consider 12am and 12pm correctly, this fixes that. This fixes issue openwebwork#2572
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a course, go to Course Config, and set Default Time that the Assignment is Due to '12:30pm', and save. Then try to create a new set, either in the Sets Manager or Library Browser. This leads to an error:
It sounds like something is converting the 12 (pm) to 24, and I'm guessing it should be 12 instead. And I'm not sure if 12 (am) is handled right, but that should be examined as well.
The text was updated successfully, but these errors were encountered: