Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Restructure and add support for parsing of a date

Open TheLimeGlass opened this issue 2 years ago • 3 comments

Description

This pull request sets up future development for real time capabilities.

Changes:

  • Moved the Date class to a org.skriptlang.skript.util.date while 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 duration as 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 AD or 3: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?"

TheLimeGlass avatar Apr 04 '23 23:04 TheLimeGlass

could we add some tests for date parsing?

Pikachu920 avatar Apr 04 '23 23:04 Pikachu920

Closing due to 10 months of inactivity

sovdeeth avatar Apr 07 '24 13:04 sovdeeth

Closed? There is no changes requested. Needs reviews.

TheLimeGlass avatar Apr 29 '24 21:04 TheLimeGlass