diff options
Diffstat (limited to 'kvision-modules/kvision-moment')
-rw-r--r-- | kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/KVManagerMoment.kt | 2 | ||||
-rw-r--r-- | kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/Options.kt | 100 | ||||
-rw-r--r-- | kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/moment/Moment.kt (renamed from kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/js/Moment.kt) | 39 |
3 files changed, 23 insertions, 118 deletions
diff --git a/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/KVManagerMoment.kt b/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/KVManagerMoment.kt index b1a35552..0000db83 100644 --- a/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/KVManagerMoment.kt +++ b/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/KVManagerMoment.kt @@ -21,8 +21,6 @@ */ package pl.treksoft.kvision -import pl.treksoft.kvision.require - internal val kVManagerMomentInit = KVManagerMoment.init() /** diff --git a/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/Options.kt b/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/Options.kt deleted file mode 100644 index fef685e0..00000000 --- a/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/Options.kt +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2017-present Robert Jaros - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.fleethome.util.kvision - -import pl.treksoft.kvision.utils.obj -import kotlin.js.Promise - -/** - * Format Display Option. - */ -enum class FormatDisplayOption(internal val displayOption: String) { - MonthM("M"), - MonthMo("Mo"), - MonthMM("MM"), - MonthMMM("MMM"), - MonthMMMM("MMMM"), - QuarterQ("Q"), - QuarterQo("Qo"), - DayOfMonthD("D"), - DayOfMonthDo("Do"), - DayOfMonthDD("DD"), - DayOfYearDDD("DDD"), - DayOfYearDDDo("DDDo"), - DayOfYearDDDD("DDDD"), - DayOfWeekdo("do"), - DayOfWeekdd("dd"), - DayOfWeekddd("ddd"), - DayOfWeekdddd("dddd"), - DayOfWeekLocale("e"), - DayOfWeekISO("E"), - WeekOfYearw("w"), - WeekOfYearwo("wo"), - WeekOfYearww("ww"), - WeekOfYearISOW("W"), - WeekOfYearISOWo("Wo"), - WeekOfYearISOWW("WW"), - YearYY("YY"), - YearYYYY("YYYY"), - YearY("Y"), - WeekYeargg("gg"), - WeekYeargggg("gggg"), - WeekYearISOGG("GG"), - WeekYearISOGGGG("GGGG"), - AmPmUpperCase("A"), - AmPmLowerCase("a"), - HourH("H"), - HourHH("HH"), - Hourh("h"), - Hourhh("hh"), - Hourk("k"), - Hourkk("kk"), - Minutem("m"), - Minutemm("mm"), - Seconds("s"), - Secondss("ss"), - FractionalSecondS("S"), - FractionalSecondSS("SS"), - FractionalSecondSSS("SSS"), - FractionalSecondSSSS("SSSS"), - TimeZoneZ("Z"), - TimeZoneZZ("ZZ"), - Unix("X"), - UnixMM("x") -} - -/** - * Localized Format Display Option. - */ -enum class LocalizedFormatDisplayOption(internal val displayOption: String) { - LT("LT"), - LTS("LTS"), - L("L"), - l("l"), - LL("LL"), - ll("ll"), - LLL("LLL"), - lll("lll"), - LLLL("LLLL"), - llll("llll") -}
\ No newline at end of file diff --git a/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/js/Moment.kt b/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/moment/Moment.kt index 95827ce6..9eb9d9a7 100644 --- a/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/js/Moment.kt +++ b/kvision-modules/kvision-moment/src/main/kotlin/pl/treksoft/kvision/moment/Moment.kt @@ -1,20 +1,29 @@ -@file:Suppress( - "INTERFACE_WITH_SUPERCLASS", - "OVERRIDING_FINAL_MEMBER", - "RETURN_TYPE_MISMATCH_ON_OVERRIDE", - "CONFLICTING_OVERLOADS", - "EXTERNAL_DELEGATION", - "NESTED_CLASS_IN_EXTERNAL_INTERFACE", - "unused", "PropertyName", "TooManyFunctions", "VariableNaming", "MaxLineLength" -) +/* + * Copyright (c) 2017-present Robert Jaros + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package pl.treksoft.kvision.moment -package pl.treksoft.kvision.moment.js - -import com.fleethome.util.kvision.FormatDisplayOption -import com.fleethome.util.kvision.LocalizedFormatDisplayOption import kotlin.js.Date -@Suppress("ClassName") +@Suppress("unused") @JsNonModule @JsModule("moment") open external class Moment { @@ -34,8 +43,6 @@ open external class Moment { open fun utcOffset(amount: dynamic): dynamic = definedExternally open fun utcOffset(amount: dynamic, keepExistingTimeOfDay: Boolean): dynamic = definedExternally open fun format(pattern: String): dynamic = definedExternally - open fun format(displayOption: FormatDisplayOption): dynamic = definedExternally - open fun format(localizedDisplayOption: LocalizedFormatDisplayOption): dynamic = definedExternally open fun format(): dynamic = definedExternally open fun fromNow(): dynamic = definedExternally open fun fromNow(withoutSuffix: Boolean): dynamic = definedExternally |