-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Javafy needed Instant implementation
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 - Sebastian Ritter <[email protected]> | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
// This Instant extension encapsulate the compatibility layer for AnyDate users in respect of the AnyDate project | ||
extension java.time.Instant { | ||
|
||
@available(*, deprecated, renamed: "EPOCH", message: "this implementation is for compatibility") | ||
public static var epoch: java.time.Instant { return java.time.Instant.EPOCH} | ||
|
||
@available(*, deprecated, renamed: "MIN", message: "this implementation is for compatibility") | ||
public static var min: java.time.Instant { return java.time.Instant.MIN } | ||
|
||
@available(*, deprecated, renamed: "MAX", message: "this implementation is for compatibility") | ||
public static var max: java.time.Instant { return java.time.Instant.MAX } | ||
|
||
// AnyDate compatible | ||
@available(*, deprecated, renamed: "plusSeconds", message: "this implementation is for compatibility") | ||
public func plus(second: Int64) -> java.time.Instant { | ||
return self.plusSeconds(second) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters