|
| 1 | +/** |
| 2 | + * Copyright (c) 2002-2018 "Neo Technology," |
| 3 | + * Network Engine for Objects in Lund AB [http://neotechnology.com] |
| 4 | + * |
| 5 | + * This file is part of Neo4j. |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +import { |
| 21 | + CypherDate, |
| 22 | + CypherDateTimeWithZoneOffset, |
| 23 | + CypherDuration, |
| 24 | + CypherLocalDateTime, |
| 25 | + CypherLocalTime, |
| 26 | + CypherTime, |
| 27 | + isCypherDate, |
| 28 | + isCypherDateTimeWithZoneId, |
| 29 | + isCypherDateTimeWithZoneOffset, |
| 30 | + isCypherDuration, |
| 31 | + isCypherLocalDateTime, |
| 32 | + isCypherLocalTime, |
| 33 | + isCypherTime |
| 34 | +} from "../../../types/v1/temporal-types"; |
| 35 | +import Integer, {int} from "../../../types/v1/integer"; |
| 36 | + |
| 37 | +const duration1: CypherDuration = new CypherDuration(int(1), int(1), int(1), int(1)); |
| 38 | +const months1: Integer = duration1.months; |
| 39 | +const days1: Integer = duration1.days; |
| 40 | +const seconds1: Integer = duration1.seconds; |
| 41 | +const nanoseconds1: Integer = duration1.nanoseconds; |
| 42 | + |
| 43 | +const duration2: CypherDuration<number> = new CypherDuration(1, 1, 1, 1); |
| 44 | +const months2: number = duration2.months; |
| 45 | +const days2: number = duration2.days; |
| 46 | +const seconds2: number = duration2.seconds; |
| 47 | +const nanoseconds2: number = duration2.nanoseconds; |
| 48 | + |
| 49 | +const localTime1: CypherLocalTime = new CypherLocalTime(int(1), int(1), int(1), int(1)); |
| 50 | +const localTime1Hour1: Integer = localTime1.hour; |
| 51 | +const localTime1Minute1: Integer = localTime1.minute; |
| 52 | +const localTime1Second1: Integer = localTime1.second; |
| 53 | +const localTime1Nanosecond1: Integer = localTime1.nanosecond; |
| 54 | + |
| 55 | +const localTime2: CypherLocalTime<number> = new CypherLocalTime(1, 1, 1, 1); |
| 56 | +const localTime2Hour1: number = localTime2.hour; |
| 57 | +const localTime2Minute1: number = localTime2.minute; |
| 58 | +const localTime2Second1: number = localTime2.second; |
| 59 | +const localTime2Nanosecond1: number = localTime2.nanosecond; |
| 60 | + |
| 61 | +const time1: CypherTime = new CypherTime(localTime1, int(1)); |
| 62 | +const localTime3: CypherLocalTime = time1.localTime; |
| 63 | +const offset1: Integer = time1.offsetSeconds; |
| 64 | + |
| 65 | +const time2: CypherTime<number> = new CypherTime(localTime2, 1); |
| 66 | +const localTime4: CypherLocalTime<number> = time2.localTime; |
| 67 | +const offset2: number = time2.offsetSeconds; |
| 68 | + |
| 69 | +const date1: CypherDate = new CypherDate(int(1), int(1), int(1)); |
| 70 | +const date1Year1: Integer = date1.year; |
| 71 | +const date1Month1: Integer = date1.month; |
| 72 | +const date1Day1: Integer = date1.day; |
| 73 | + |
| 74 | +const date2: CypherDate<number> = new CypherDate(1, 1, 1); |
| 75 | +const date2Year1: number = date2.year; |
| 76 | +const date2Month1: number = date2.month; |
| 77 | +const date2Day1: number = date2.day; |
| 78 | + |
| 79 | +const localDateTime1: CypherLocalDateTime = new CypherLocalDateTime(date1, localTime1); |
| 80 | +const date3: CypherDate = localDateTime1.localDate; |
| 81 | +const localTime5: CypherLocalTime = localDateTime1.localTime; |
| 82 | + |
| 83 | +const localDateTime2: CypherLocalDateTime<number> = new CypherLocalDateTime(date2, localTime2); |
| 84 | +const date4: CypherDate<number> = localDateTime2.localDate; |
| 85 | +const localTime6: CypherLocalTime<number> = localDateTime2.localTime; |
| 86 | + |
| 87 | +const dateTime1: CypherDateTimeWithZoneOffset = new CypherDateTimeWithZoneOffset(localDateTime1, int(1)); |
| 88 | +const localDateTime3: CypherLocalDateTime = dateTime1.localDateTime; |
| 89 | +const offset3: Integer = dateTime1.offsetSeconds; |
| 90 | + |
| 91 | +const dateTime2: CypherDateTimeWithZoneOffset<number> = new CypherDateTimeWithZoneOffset(localDateTime2, 1); |
| 92 | +const localDateTime4: CypherLocalDateTime<number> = dateTime2.localDateTime; |
| 93 | +const offset4: number = dateTime2.offsetSeconds; |
| 94 | + |
| 95 | +const isDuration: boolean = isCypherDuration(duration1); |
| 96 | +const isLocalTime: boolean = isCypherLocalTime(localTime1); |
| 97 | +const isTime: boolean = isCypherTime(time1); |
| 98 | +const isDate: boolean = isCypherDate(date1); |
| 99 | +const isLocalDateTime: boolean = isCypherLocalDateTime(localDateTime1); |
| 100 | +const isDateTimeWithZoneOffset: boolean = isCypherDateTimeWithZoneOffset(dateTime1); |
| 101 | +const isDateTimeWithZoneId: boolean = isCypherDateTimeWithZoneId(dateTime2); |
0 commit comments