Open Kethet opened 4 years ago
I tried
[<Emit("new rangePlugin({})")>] let inline rangePlugin():string = jsNative
Flatpickr.flatpickr
[
Flatpickr.DateFormat "m.y"
Flatpickr.custom "plugins"
[|rangePlugin()|]
true
Flatpickr.ClassName "input" ]
which will emit proper js
(\"plugins\", [new rangePlugin({})], true)
but it looks like rangeplugin is not properly referneced
i tried importAll "flatpickr/dist/plugins/weekSelect/weekSelect.js" and import "rangePlugin" "flatpickr/dist/plugins/rangePlugin"
@Zaid-Ajaj can you please lead us to a proper way?
So i was able to get it works this way:
importAll "flatpickr/dist/plugins/monthSelect/style.css"
let monthSelectPlugin (x: obj): obj -> obj =
importDefault "flatpickr/dist/plugins/monthSelect"
Flatpickr.flatpickr [
Flatpickr.DateFormat "m.y"
Flatpickr.custom
"plugins"
[| monthSelectPlugin
({| shorthand = true
dateFormat = "m.y"
altFormat = "F Y" |}) |]
true
Flatpickr.Locale Flatpickr.Locales.czech
Flatpickr.ClassName "input" ]
Thank you very much! Based on this fable-flatpickr project, and this issue, I was able to successfully implement a Fable binding for FullCallendar, that can be used like this:
FullCalendar.fullCalendar [
FullCalendar.Plugins [| dayGridPlugin; interactionPlugin; timeGridPlugin |]
FullCalendar.HeaderToolbar [ ToolbarSection.Left, "prev,next today"
ToolbarSection.Center, "title"
ToolbarSection.Right, "dayGridMonth,timeGridWeek,timeGridDay"
]
FullCalendar.EventClick (HandleDateSelected >> dispatch)
FullCalendar.DateClick (ClickOnSelectedDate >> dispatch)
FullCalendar.Editable true
FullCalendar.Droppable true
FullCalendar.InitialView "dayGridMonth"
FullCalendar.EventColor "red"
]
But boy, what a struggle to find something helpful...
@spingee Good morning, a question? This code also works for you to be able to visualize from the Y-m cell phone.
I have an app that needs to do week selection.
The Flatpickr library comes with a plugin for this, but it is not currently support by this library.
I have tried the following
Though that gives the following error
If I change the
true
tofalse
It doesn't give an error, but no changes in functionality are observed.I have tried my best at adding support for this using
[<Emit>]
ers, but I'm too new to Fable to get it to work.