mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
more messing with time, applying default time on drag and drop
This commit is contained in:
@@ -31,14 +31,9 @@
|
||||
{
|
||||
get
|
||||
{
|
||||
// 12 AM
|
||||
@* if (Time.Hour == 0)
|
||||
return 12; *@
|
||||
// AM hours
|
||||
if (Time.Hour <= 11)
|
||||
return Time.Hour;
|
||||
// PM hours
|
||||
return Time.Hour + 1 - 12;
|
||||
var time = Time.Hour % 12;
|
||||
if (time == 0) return 12;
|
||||
return time;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +66,7 @@
|
||||
>
|
||||
<option
|
||||
value="12"
|
||||
selected="@(12 == Time.Hour)"
|
||||
selected="@(12 == AdjustedHour)"
|
||||
>
|
||||
12
|
||||
</option>
|
||||
@@ -79,7 +74,7 @@
|
||||
{
|
||||
<option
|
||||
value="@hour"
|
||||
selected="@(hour == Time.Hour)"
|
||||
selected="@(hour == AdjustedHour)"
|
||||
>
|
||||
@hour.ToString("00")
|
||||
</option>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
}
|
||||
private Modal? assignmentEditorModal {get; set;}
|
||||
|
||||
private void dropOnDate(DateTime dropDate)
|
||||
private void dropOnDate(DateTime dropDate)
|
||||
{
|
||||
if (planner.LocalCourse == null) return;
|
||||
var currentModule = planner
|
||||
@@ -37,6 +37,16 @@
|
||||
.Select(a => a.id)
|
||||
.Contains(Assignment.id)
|
||||
) ?? throw new Exception("in day callback, could not find module");
|
||||
|
||||
|
||||
var defaultDueTimeDate = new DateTime(
|
||||
year: dropDate.Year,
|
||||
month: dropDate.Month,
|
||||
day: dropDate.Day,
|
||||
hour: planner.LocalCourse.DefaultDueTime.Hour,
|
||||
minute: planner.LocalCourse.DefaultDueTime.Minute,
|
||||
second: 0
|
||||
);
|
||||
var moduleWithUpdatedAssignment = currentModule with
|
||||
{
|
||||
Assignments = currentModule.Assignments.Select(a =>
|
||||
@@ -44,7 +54,7 @@
|
||||
? a
|
||||
: a with
|
||||
{
|
||||
due_at=dropDate
|
||||
due_at=defaultDueTimeDate
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
@@ -19,6 +19,16 @@
|
||||
.Select(a => a.id)
|
||||
.Contains(Assignment.id)
|
||||
) ?? throw new Exception("in day callback, could not find module");
|
||||
|
||||
var defaultDueTimeDate = new DateTime(
|
||||
year: dropDate.Year,
|
||||
month: dropDate.Month,
|
||||
day: dropDate.Day,
|
||||
hour: planner.LocalCourse.DefaultDueTime.Hour,
|
||||
minute: planner.LocalCourse.DefaultDueTime.Minute,
|
||||
second: 0
|
||||
);
|
||||
|
||||
var moduleWithUpdatedAssignment = currentModule with
|
||||
{
|
||||
Assignments = currentModule.Assignments.Select(a =>
|
||||
@@ -26,7 +36,7 @@
|
||||
? a
|
||||
: a with
|
||||
{
|
||||
due_at=dropDate
|
||||
due_at=defaultDueTimeDate
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user