Dirk
01/10/2023, 2:14 PMDirk
01/10/2023, 2:15 PMexport = dayjs;
declare function dayjs (date?: dayjs.ConfigType): dayjs.Dayjs
declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs
declare function dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs
declare namespace dayjs {
interface ConfigTypeMap {
default: string | number | Date | Dayjs | null | undefined
}
// More Types
//...
class Dayjs {
constructor (config?: ConfigType)
/**
* All Day.js objects are immutable. Still, `dayjs#clone` can create a clone of the current object if you need one.
*
* dayjs().clone()// => Dayjs
* dayjs(dayjs('2019-01-25')) // passing a Dayjs object to a constructor will also clone it
* * Docs: <https://day.js.org/docs/en/parse/dayjs-clone>
*/
clone(): Dayjs
/**
* This returns a `boolean` indicating whether the Day.js object contains a valid date or not.
*
* dayjs().isValid()// => boolean
* * Docs: <https://day.js.org/docs/en/parse/is-valid>
*/
isValid(): boolean
//....
Dirk
01/10/2023, 2:17 PMdayjs()
is unknown:
@file:JsModule("dayjs")
@file:JsNonModule
package libs.antd.datepicker.dayjs
import kotlin.js.Date
@JsName("default")
external fun dayjs(date: Any? = definedExternally, format: Any? = definedExternally, locale: Any? = definedExternally, strict: Boolean? = definedExternally): Dayjs
@JsName("default")
external class Dayjs(config: Any? = definedExternally) {
// 2023
fun year(): Number
// 0-11
fun month(): Number
// More functions ....
turansky
01/10/2023, 3:31 PM@file:JsQualifier("default")
for declarations from namespaceDirk
01/10/2023, 4:00 PMturansky
01/10/2023, 7:50 PM// 1.kt
@file:JsModule("dayjs")
extend()
locale()
class Dayjs
// 2.1.kt
@file:JsModule("dayjs")
@JsName("default")
fun dayjs()
@JsName("default")
fun dayjs()
@JsName("default")
fun dayjs()
// 2.2.kt
@JsModule("dayjs")
fun dayjs()
@JsModule("dayjs")
fun dayjs()
@JsModule("dayjs")
fun dayjs()
Looks like this
2.1 or 2.2 - it’s faster to test 🙂Dirk
01/11/2023, 10:58 AMDirk
01/13/2023, 11:01 AMturansky
01/13/2023, 12:04 PMconsole.log
if you have dayjs
in your dependencies