-
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.
[~] fix date conversion which added/subtracted time offset without co…
…nsideration for time zone
- Loading branch information
Showing
4 changed files
with
19 additions
and
16 deletions.
There are no files selected for viewing
7 changes: 3 additions & 4 deletions
7
...iceBackend/src/main/kotlin/office/effective/features/booking/converters/DateExtensions.kt
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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
package office.effective.features.booking.converters | ||
|
||
import com.google.api.client.util.DateTime | ||
import office.effective.common.constants.BookingConstants | ||
|
||
/** | ||
* Converts local time to Google [DateTime] in GMT. | ||
* Converts local time to [DateTime]. | ||
* | ||
* Use it for all requests to Google Calendar. | ||
*/ | ||
fun Long.toGoogleDateTime(): DateTime { | ||
return DateTime(this - BookingConstants.DEFAULT_TIMEZONE_OFFSET_MILLIS) | ||
fun Long.toDateTime(): DateTime { | ||
return DateTime(this) | ||
} |
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
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
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