bevacqua / rome

:calendar: Customizable date (and time) picker. Opt-in UI, no jQuery!
https://bevacqua.github.io/rome
MIT License
2.91k stars 223 forks source link

Disabled attribute is not being applied to the dom for the back or next buttons. #129

Open AntiFish03 opened 9 years ago

AntiFish03 commented 9 years ago

I saw this in the css

.rd-back[disabled],
.rd-next[disabled] {
  cursor: default;
}

but I have noticed that disabled never gets added as an attribute to the button.

bevacqua commented 9 years ago

https://github.com/bevacqua/rome/blob/fb6203fe9675a5d7648ecf2fff192162c8b05a59/src/calendar.js#L491-L492

AntiFish03 commented 9 years ago

rome-no disabled-code rome-no disabled

I am not seeing the back button ever receive the disabled attribute on the dom, the JS is working correctly as far as not allowing the navigation back but I am not able to style a disabled state. So let me update the issues title with disabled attribute is not appearing on the dom.

bevacqua commented 9 years ago

Well yes if you don't disable any dates the back button won't be disabled

AntiFish03 commented 9 years ago

My min date is set as today... does that not disable previous dates?

bevacqua commented 9 years ago

Yes, it should

screen shot 2015-08-27 at 19 45 32
AntiFish03 commented 9 years ago

Ok so my options for that picker the ele is a generic element.

cal = rome(ele, {
  monthsInCalendar: 2
  , time: false
  , min: moment(new Date().setHours(0,0,0,0))
  , inputFormat: 'MM/DD/YYYY'
});

And I am never getting the disabled attribute. The JS prevents the navigation to the previous month but never sets the attribute.

AntiFish03 commented 9 years ago

if you want it I created a code pen http://codepen.io/anon/pen/PPYJrm

AntiFish03 commented 8 years ago

@bevacqua, I was curious if you have had the opportunity, look into this?