forked from Submitty/Submitty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refactor:SubmittyUtils] Cleanup dateutils.write_submitty_date to be …
…more consistent (Submitty#5545) This updates the write_submitty_date function to be a bit more consistent and with less potential foot-guns. First, instead of printing an error to console, but still returning if given an invalid type, this function will now throw an exception, so that if someone were to somehow get an integer into this function, we should not return an integer back and have some other crash later in an unrelated system. Scanning through the codebase, we always use this function with datetimes at the moment at least. Second, remove the space between the milliseconds and timezone if using milliseconds to match the format of the non-milliseconds datetime string, as well as just generally where someone would expect the "-0400" string. Third, the optional parameter to add milliseconds to the datetime string was named "microseconds", and so it was renamed to "milliseconds" to be consistent with what it was actually doing. Signed-off-by: Matthew Peveler <[email protected]>
- Loading branch information
1 parent
fe8b5fa
commit 6b99ba8
Showing
5 changed files
with
127 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters