Skip to content

"档案编辑"-"调课"-"自定义日期"中的日期越界问题 #1863

Description

@luyii-code-1

检查清单

  • 我已更新到最新版 最新的版本号最新的版本号 测试,并看过 最新提交,确认这一 Bug 还没有修复。我也已在 Issues 中检索,确认这一 Bug 未被提交过,并且在 常见问题 中没有解决方案。
  • 我已经仔细阅读过选项里的内容,并且知道这个选项不用勾选。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题(关于其他非程序本身的问题应当在 Discussion 板块提出)。

期望的行为

在"档案编辑"-"调课"-"自定义日期"可以自己输入需要调节的日期,但是这个输入框目前没有输入检查,导致日期处于12/31/9999或者1/1/0001时点击按钮切换上/下一周时会触发日期越界BUG

实际结果

程序发生崩溃

重现步骤

1.打开"档案编辑"
2.点击"调课"
3.在日期输入框输入"12/31/9999"
4.点击切换到下一周

截图/录屏(可选,建议)

Image Image

堆栈跟踪(可选)

System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. (Parameter 'value')
   at System.DateTime.ThrowDateArithmetic(Int32 param)
   at System.DateTime.AddDays(Double value)
   at ClassIsland.Controls.ScheduleDataGrid.ScheduleDataGrid.RefreshWeekScheduleRows(Boolean changeFromDate) in /_/ClassIsland/Controls/ScheduleDataGrid/ScheduleDataGrid.axaml.cs:line 277
   at ClassIsland.Controls.ScheduleDataGrid.ScheduleDataGrid.ButtonNextWeek_OnClick(Object sender, RoutedEventArgs e) in /_/ClassIsland/Controls/ScheduleDataGrid/ScheduleDataGrid.axaml.cs:line 233
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
   at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e)
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
   at Avalonia.Controls.Button.OnClick()
   at Avalonia.Controls.Button.OnPointerReleased(PointerReleasedEventArgs e)
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
   at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e)
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
   at Avalonia.Input.MouseDevice.MouseUp(IMouseDevice device, UInt64 timestamp, IInputRoot root, Point p, PointerPointProperties props, KeyModifiers inputModifiers, IInputElement hitTest)
   at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs e)
   at Avalonia.Controls.TopLevel.<>c.<HandleInput>b__150_0(Object state)
   at Avalonia.Threading.Dispatcher.Send(SendOrPostCallback action, Object arg, Nullable`1 priority)

诊断信息

System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. (Parameter 'value')
   at System.DateTime.ThrowDateArithmetic(Int32 param)
   at System.DateTime.AddDays(Double value)
   at ClassIsland.Controls.ScheduleDataGrid.ScheduleDataGrid.RefreshWeekScheduleRows(Boolean changeFromDate) in /_/ClassIsland/Controls/ScheduleDataGrid/ScheduleDataGrid.axaml.cs:line 277
   at ClassIsland.Controls.ScheduleDataGrid.ScheduleDataGrid.ButtonNextWeek_OnClick(Object sender, RoutedEventArgs e) in /_/ClassIsland/Controls/ScheduleDataGrid/ScheduleDataGrid.axaml.cs:line 233
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
   at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e)
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
   at Avalonia.Controls.Button.OnClick()
   at Avalonia.Controls.Button.OnPointerReleased(PointerReleasedEventArgs e)
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
   at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e)
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
   at Avalonia.Input.MouseDevice.MouseUp(IMouseDevice device, UInt64 timestamp, IInputRoot root, Point p, PointerPointProperties props, KeyModifiers inputModifiers, IInputElement hitTest)
   at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs e)
   at Avalonia.Controls.TopLevel.<>c.<HandleInput>b__150_0(Object state)
   at Avalonia.Threading.Dispatcher.Send(SendOrPostCallback action, Object arg, Nullable`1 priority)

最后一步

  • 我认为上述的描述已经足以详细,以允许开发人员能复现该问题。如果我的 issue 没有按照上述的要求填写,可能会被无条件关闭。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug在使用 ClassIsland 的过程中遇到了 Bug优先级:无短期内不会计划完成的事项待查看等待开发者查看此 Issue

    Type

    Fields

    开发周期

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions