Skript
Skript copied to clipboard
Restructure and add support for parsing of a date
Description
This pull request sets up future development for real time capabilities.
Changes:
- Moved the Date class to a
org.skriptlang.skript.util.datewhile keeping the old class under deprecation subject to removal. - Added parsing capabilities for Date. Skript defines a date format in the config.sk but it's not really user accessible but yet it's in the config.sk. So users can now properly use that configuration node. This is most likely what Njol had in plan for the future.
- Removed
durationas a user option from TimePeriod as duration should represent real time and not Minecraft time. This will allow for usage of the duration tag in the future. - Changed the default DateFormat from SHORT to FULL. Javadoc:
Tuesday, April 12, 1952 ADor3:30:42pm PST.Skript should be writing out full statements, this is how Skript has always been. SHORT is still supported in serialization for indefinite due to legacy versions using it, and SHORT isn't getting removed, so we can keep SHORT as the serialization. - Added class TimeParser which will be used in the future for other types like month, day of the week etc.
- Removed some extra new lines from the config.sk while I was in there updating the time comments.
on join:
now is "Tuesday, April 12th 1952" parsed as date
message "Wait a minute. Wait a minute Doc, are you telling me you built a time machine out of a DeLorean?"
could we add some tests for date parsing?
Closing due to 10 months of inactivity
Closed? There is no changes requested. Needs reviews.