Skip to content

Time Until expression#5767

Closed
colton-boi wants to merge 2 commits into
SkriptLang:masterfrom
colton-boi:feature/time-difference
Closed

Time Until expression#5767
colton-boi wants to merge 2 commits into
SkriptLang:masterfrom
colton-boi:feature/time-difference

Conversation

@colton-boi
Copy link
Copy Markdown
Contributor

@colton-boi colton-boi commented Jun 25, 2023

Description

Added time until syntax to time since expression

Target Minecraft Versions: Any
Requirements: None
Related Issues: #5766

@colton-boi colton-boi changed the title initial Time Until expression Jun 25, 2023
Copy link
Copy Markdown
Member

@AyhamAl-Ali AyhamAl-Ali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR ⚡

Comment thread src/main/java/ch/njol/skript/expressions/ExprTimeDifference.java Outdated
Comment thread src/main/java/ch/njol/skript/expressions/ExprTimeDifference.java Outdated
Comment thread src/main/java/ch/njol/skript/expressions/ExprTimeDifference.java Outdated
Comment thread src/main/java/ch/njol/skript/expressions/ExprTimeDifference.java Outdated
Comment thread src/main/java/ch/njol/skript/expressions/ExprTimeDifference.java Outdated
Comment thread src/main/java/ch/njol/skript/expressions/ExprTimeDifference.java Outdated
Comment thread src/main/java/ch/njol/skript/expressions/ExprTimeDifference.java Outdated
@AyhamAl-Ali AyhamAl-Ali added the feature Pull request adding a new feature. label Jun 25, 2023
Comment thread src/main/java/ch/njol/skript/expressions/ExprTimeDifference.java
Comment on lines +48 to +49
"[the] time since %dates%",
"[the] (time [remaining]|remaining time) until %dates%");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"[the] time since %dates%",
"[the] (time [remaining]|remaining time) until %dates%");
"[the] time since %dates%",
"[the] (time [remaining]|remaining time) until %dates%");

@APickledWalrus APickledWalrus added the breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) label Jul 11, 2023
@APickledWalrus
Copy link
Copy Markdown
Member

Breaking change currently due to the change from null to 0 timespan for return type. Will need to discuss further potentially

Copy link
Copy Markdown
Member

@AyhamAl-Ali AyhamAl-Ali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops, I didn't see Pickle's note..
I think returning 0 timespan will cause inaccurate results.

@Fusezion
Copy link
Copy Markdown
Contributor

Fusezion commented Jul 26, 2023

Ops, I didn't see Pickle's note.. I think returning 0 timespan will cause inaccurate results.

this was something I bought up and originally suggested the returning 0 timespan.
can you elaborate on areas where inaccurate results might be sent? (outside of passing a null value)

returning null on null values i'm perfectly fine with just any other case I believe 0 is better

@sovdeeth
Copy link
Copy Markdown
Member

sovdeeth commented Aug 15, 2023

Ops, I didn't see Pickle's note.. I think returning 0 timespan will cause inaccurate results.

this was something I bought up and originally suggested the returning 0 timespan. can you elaborate on areas where inaccurate results might be sent? (outside of passing a null value)

returning null on null values i'm perfectly fine with just any other case I believe 0 is better

Null is consistent with other timespan expressions, namely time since. Changing both to 0 timespan would be consistent as well, but I think it's easier to go with what's already established. Edit: Didn't realize this was changing time since, which should have been obvious to me lol. My view remains that changing the established behavior doesn't really make sense here; there's no real benefit to 0 timespan vs null imo and the change in behavior isn't worth the slight improvement in intuition.

@UnderscoreTud
Copy link
Copy Markdown
Member

Closed in favor of #6203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) feature Pull request adding a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants