kotlin-material-ui
kotlin-material-ui copied to clipboard
How is a `datePicker` wrapped in `LocalizationProvider`?
I've tried
+LocalizationProvider {
+datePicker { }
}
with no attrs
provided to LocalizationProviderBuilder
, but this throws a (probably unrelated) javascript error TypeError: n is not a constructor
.
How exactly do I provide DateFnsUtils
to the LocalizationProvider
?
Here is how I managed to get it working on my side:
LocalizationProvider {
attrs {
dateFnsAdapter()
locale(enUS)
}
dateTimePicker {
...
}
}
Thanks for publishing, @lucgirardin.
I haven't managed to replicate your success; what versions of everything are you using? The only configuration I can even get to build is
implementation(npm("@material-ui/pickers", "4.0.0-alpha.11"))
implementation("net.subroh0508.kotlinmaterialui:core:0.5.2")
implementation("net.subroh0508.kotlinmaterialui:lab:0.5.2")
implementation("net.subroh0508.kotlinmaterialui:date-io:0.5.2")
implementation("net.subroh0508.kotlinmaterialui:pickers:0.5.2")
That's right, I had to tweak a bit the dependencies and create my own Kotlin wrapper around data-fns. Here is what I am using:
implementation("net.subroh0508.kotlinmaterialui:pickers:0.5.3") {
exclude("subroh0508.net.kotlinmaterialui", "date-io")
}
api(npm("@material-ui/pickers", "4.0.0-alpha.12"))
api(npm("@date-io/core", "^2.6.0"))
api(npm("@date-io/date-fns", "^2.6.0"))
api(npm("date-fns", "^2.12.0"))