-
Notifications
You must be signed in to change notification settings - Fork 89
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
DateTime Library Implementation #94
Conversation
* to_datetime_constructor (internal): converts DateTime to DateTimeConstructor * to_local_time: converts DateTime to DateTimeConstructor with local timezone * to_universal_time: converts DateTime to DateTimeConstructor with UTC timezone * to_iso_date: converts DateTime to UTC ISO 8601 string
* format_time: formats the current DateTime to a string with a specified locale and timezone
The following was implemented: * trait FromLua for DateTimeBuilder * trait UserDate for DateTimeBuilder * toUniversalTime * fromUniversalTime
This commit finishes the DateTime implementation for the luau side library. It includes the following methods: * fromLocalTime * toLocalTime
Discovered something about the bug with What could be a reason for such behavior? UPDATE: It functions as expected with any timestamp now, the issue was with the |
The only issue as of now for the tests to pass is that for localization tests. We need a certain locale to be included and the cache to updated, which requires superuser privileges. I've tried doing this on the rust side in tests.rs but its a bit tricky to non-interactively run sudo. Any other way we could go about doing this? Relevant code: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for implementing this! 🚀 I'll make the discussed changes some time this week, too
LGTM! 🚀 |
This PR aims to implement a DateTime builtin library, inspired by the Roblox DateTime with some changes.
Things to implement before merge:
create
function and adding the builtin tomod.rs
&str
toMonth
is problematic, chrono maps "march" toMonth::January
DateTime::from_iso_date
DateTime::from_unix_timestamp
DateTime.toIsoDate()
DateTime.toUniversalTime()
fromUniversalTime
&fromLocalTime
formatTime
for conversion to local timezoneCloses #52.