FormatException: The DateTime represented by the string is not supported in calendar 2023-04-31 23:59. // :: timeInfo.endTime issue
s-saens opened this issue · comments
Service
- Manager
Version
2.2.2
Describe the bug
Manager window를 열었을 때 창에 내용이 뜨지 않음. 다음 에러 메시지 뜸:
FormatException: The DateTime represented by the string is not supported in calendar 2023-04-31 23:59.
System.DateTimeParse.ParseExact
To Reproduce
Tools > GPM > Manager
Expected behavior
Manager 창이 떠야 함.
Screenshots
Error Message
FormatException: The DateTime represented by the string is not supported in calendar 2023-04-31 23:59.
System.DateTimeParse.ParseExact (System.ReadOnlySpan`1[T] s, System.ReadOnlySpan`1[T] format, System.Globalization.DateTimeFormatInfo dtfi, System.Globalization.DateTimeStyles style) (at <5b93611b6ff043439d403fbb0837bc10>:0)
System.DateTime.ParseExact (System.String s, System.String format, System.IFormatProvider provider) (at <5b93611b6ff043439d403fbb0837bc10>:0)
Gpm.Manager.Util.ManagerTime.ParseTimeInfo (System.String time) (at Assets/GPM/Manager/Editor/Util/ManagerTime.cs:19)
Gpm.Manager.Constant.NoticeInfo+NoticeList+Notice.IsActiveTime () (at Assets/GPM/Manager/Editor/Constant/Vo/NoticeInfo.cs:48)
Gpm.Manager.Notice.GpmNotice.get_HasNotice () (at Assets/GPM/Manager/Editor/Util/Notice/Notice.cs:106)
Gpm.Manager.Ui.GpmManagerWindow.DoInfoGUI () (at Assets/GPM/Manager/Editor/UI/GpmManagerWindow.cs:309)
...
Environment
Unity
- 2021.3.19f1
Desktop (please complete the following information):
- OS: MacOS
- Version: Ventura 13.1, Apple Sillicon: M1
Additional context
4월에는 31일이 없어서 발생한 에러입니다.
클라이언트 측 코드에는 문제가 없는 것 같고, 클라이언트 Notice.cs에서 요청하여 얻은 xml에서부터 timeInfo.endTime이 2023-04-31 으로 찍히는 것을 보니 서버 측에서 수정이 필요해 보입니다.
Log:
REQUESTED DATA:
<?xml version="1.0" encoding="UTF-8" ?>
<noticeInfo>
<noticeList>
<notice>
<text>NOTICE_TEXT_1</text>
<url>NOTICE_LINK_1</url>
<timeInfo>
<startTime>2022-12-23 00:00</startTime>
<endTime>2023-04-31 23:59</endTime>
<day>
<start>00</start>
<end>24</end>
</day>
</timeInfo>
</notice>
<notice>
<text>NOTICE_TEXT_2</text>
<url>NOTICE_LINK_2</url>
<timeInfo>
<startTime>2019-07-23 00:00</startTime>
<endTime>2029-12-31 23:59</endTime>
<day>
<start>00</start>
<end>24</end>
</day>
</timeInfo>
</notice>
</noticeList>
</noticeInfo>
NoticeInfo.cs의 46번째 줄(IsActiveTime 메서드의 첫 줄)에 다음 코드를 추가해서 임시로 해결했습니다.
timeInfo.endTime = "2023-04-30 23:59";