-
Notifications
You must be signed in to change notification settings - Fork 101
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
Implement the same ranges for all platforms #453
base: master
Are you sure you want to change the base?
Conversation
0f69a99
to
74cbbe3
Compare
b7c293c
to
ae4373e
Compare
ae4373e
to
e1a2c61
Compare
* @see LocalDate.fromEpochDays | ||
* @sample kotlinx.datetime.test.samples.LocalDateSamples.toEpochDays | ||
*/ | ||
public fun toEpochDays(): Int | ||
public fun toEpochDays(): Long |
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.
Have you considered retaining source and/or binary compatibility?
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.
We didn't find a way to choose an overload based on its return type, so we can't restore source compatibility. Also, on Native, the binary compatibility can't be restored, as two signatures with different return types cause a compilation error.
Restored the binary compatibility for the JVM.
zones[components[0]]?.let { rules -> | ||
zones[components[1]] = rules | ||
} |
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.
Is the order of the two time zones specified? I mean is it possible that the second time zone has rules but the first doesn't?
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.
https://momentjs.com/timezone/docs/#/data-formats/link-format/ doesn't say anything either way, so the js-joda implementation is the best guidance we have on this, and they do assume this order.
} catch (e: IllegalArgumentException) { | ||
throw DateTimeArithmeticException("Boundaries of LocalDate exceeded when adding a value", e) | ||
} | ||
public actual fun LocalDate.plus(unit: DateTimeUnit.DateBased): LocalDate = plus(1, unit) |
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.
Nit: Can the implementation be moved to the common source set?
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.
I don't think so. The JVM overload is in @file:JvmName("LocalDateJvmKt")
, and moving it to LocalDateKt
would be a breaking change. We could keep a LowPriorityInOverloadResolution
DeprecationLevel.HIDDEN
copy in LocalDateJvmKt
, but then what's the point in moving it to common code? It's deprecated anyway.
Fixes #432