Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added monthSelect plugin. #745

Merged
merged 2 commits into from
May 3, 2018
Merged

Added monthSelect plugin. #745

merged 2 commits into from
May 3, 2018

Conversation

skatt
Copy link
Contributor

@skatt skatt commented Apr 10, 2017

It works similarly to the weekSelect plugin.

It works similarly to the weekSelect plugin.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.299% when pulling 55e5add on skatt:monthSelect into 41ac3a8 on chmln:master.

@chmln
Copy link
Member

chmln commented Apr 11, 2017

Not sure if its necessary to display the days here.

I was thinking of something more like:
jquery-mobile-plugin-for-multiple-month-picker

(without the range, that is)

@skatt
Copy link
Contributor Author

skatt commented Apr 14, 2017

I agree. I'm not extremely familiar with the code. If you could point me in the direction of overriding the calendar render, I'd be happy to complete the plugin. I have a pretty good idea of how to make the container for the months and everything, just no clue how to change the popup itself.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.098% when pulling 03f5982 on skatt:monthSelect into 7dcd64d on chmln:master.

@chmln
Copy link
Member

chmln commented Apr 15, 2017

@skatt just create some div and append it to fp.rContainer.

First, I'd add some class to fp.calendarContainer like "monthSelect".

Then, you could hide the month name and weekdays by

.flatpickr-calendar.monthSelect
    span.cur-month, div.flatpickr-weekdays
        display none

Second: hiding days - hook into onParseConfig and set fp.config.noCalendar = true.

Third: prevent arrows from changing months and change years instead

fp.prevMonthNav.removeEventListener("click", fp.prevMonthFn);
fp.nextMonthNav.removeEventListener("click", fp.nextMonthFn);

Then add your own listeners and just increase/decrease fp.currentYear.

The rest should be just a matter of styling.

@chmln chmln mentioned this pull request Jul 7, 2017
@aseem2625
Copy link

Merge this please!

@chmln
Copy link
Member

chmln commented Sep 30, 2017

Hello,

Thank you for your work on the plugin.
I will soon convert it to typescript and merge into master.

@oller
Copy link

oller commented Oct 25, 2017

Looks great, will this support month range selection?

@eliteproxy7
Copy link

sorry if this sounds stupid but how can I use this?

@oller
Copy link

oller commented Nov 15, 2017

@eliteproxy7, this is an unmerged pull request, so it's not in the released version yet.

@eliteproxy7
Copy link

I downloaded from this pull I placed the monthSelect folder in my plugins directory.

I also incldued the monthSelect.js & monthSelect.css in my Gulp script.

here is my code

if ($('.date-picker-my')[0]) {
        $('.date-picker-my').flatpickr({
            plugins: new monthSelect({}),
            onChange: function(selectedDates, dateStr, instance) {
                var elment = instance.element.getAttribute('data-credititem');       
            },
            enableTime: false,
           // dateFormat: "m-d-Y",
            nextArrow: '<i class="zmdi zmdi-long-arrow-right" />',
            prevArrow: '<i class="zmdi zmdi-long-arrow-left" />'
        });
    }

i get this error
ReferenceError: monthSelect is not defined

@eliteproxy7
Copy link

I got it running.. sort of

flatpickr(".date-picker-my", {
plugins: [new monthSelectPlugin({ })]
});

but its showing the dateRange functionality and I do not have the daterange included anywhere

@MamesPalmero
Copy link

Does anyone know if this will be merged soon?

@ghost
Copy link

ghost commented Mar 9, 2018

I would also like to know if this will be merged.. hopefully soon.

@mankinchi
Copy link

How is the progress on adding this to master?

@chmln chmln merged commit 09b790a into flatpickr:master May 3, 2018
@chmln
Copy link
Member

chmln commented May 3, 2018

Hey all,

This is what the plugin looks like:

screenshot from 2018-05-03 13-04-15

I may work on this plugin further in the future, but you can have it now :)

@gr8tushar
Copy link

Hi,
Is the month selection merged in the main branch. If so, do we have the updated documentation for the same ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants