Skip to content

Timezone Support #7887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: dev/feature
Choose a base branch
from

Conversation

erenkarakal
Copy link
Member

@erenkarakal erenkarakal commented May 22, 2025

Problem

There isn't a way to get the date in a timezone without knowing its time offset.

Solution

Adds three new syntaxes for working with time zones.

Expressions:
[the] [date[s]] %dates% in time[ ]zone %string% or [the] [date[s]] %dates% in [the] %string% time[ ]zone
all [of [the]] time[ ]zones

Conditions:
%strings% (are|is [a[n]]) [negate:in]valid time[ ]zone[s]

This PR also forces the test environment to use the UTC timezone.

Testing Completed

Tests are available in timezones.sk

Supporting Information

  • - Tests
  • - Change description
  • - Add docs

Completes: none
Related: none

@erenkarakal erenkarakal requested a review from a team as a code owner May 22, 2025 15:47
@erenkarakal erenkarakal requested review from Efnilite and cheeezburga and removed request for a team May 22, 2025 15:47
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label May 22, 2025
@sovdeeth sovdeeth added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label May 22, 2025
@sovdeeth sovdeeth moved this to Needs Reviews in 2.12 Release Jun 3, 2025
@sovdeeth sovdeeth moved this from Needs Reviews to In Progress in 2.12 Release Jun 3, 2025
@erenkarakal erenkarakal added the don't merge me !! For pull requests that should not be merged due to some outstanding dispute, conflict or dependency. label Jun 4, 2025
@erenkarakal erenkarakal removed the don't merge me !! For pull requests that should not be merged due to some outstanding dispute, conflict or dependency. label Jun 4, 2025
@erenkarakal erenkarakal requested a review from a team as a code owner June 4, 2025 19:13
@erenkarakal erenkarakal requested review from UnderscoreTud and removed request for a team June 4, 2025 19:13
@erenkarakal erenkarakal moved this from In Progress to Needs Reviews in 2.12 Release Jun 4, 2025
@erenkarakal erenkarakal requested a review from sovdeeth June 4, 2025 19:26
Co-authored-by: sovdee <[email protected]>
@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label Jun 7, 2025
@erenkarakal erenkarakal requested a review from sovdeeth June 8, 2025 20:31
public class CondIsTimezoneValid extends Condition {

static {
Skript.registerCondition(CondIsTimezoneValid.class, "%strings% (are|is [a[n]]) [negate:in]valid time[ ]zone[s]");
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be a property condition, and just do setNegated(isNegated() == hasTag("negate") in init()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

7 participants