문제

I'm new in this tecs and i need to do a datetimepicker or something to choose a date vale.. is it any sort of "datetime_field"? or only is posible using Java sciprt or Jquery... I tried something like this in my code.. but nothing heppends

= f.text_field :Eventdatetime, :class => 'form-control input-large input-with-feedback'
span class='help-inline' = error ? f.error_message_on(:Eventdatetime, :class => 'text-error') : pat(:example)
javascript:
   jQuery(function() {
    debugger;
    $( "#Eventdatetime" ).datepicker();
   });

Thanks!!

도움이 되었습니까?

해결책

There's no method datepicker() in jQuery (you may be getting confused with its sister library jQuery UI) so you'll need to include an external library to implement such functionality.

I can recommend this one, I use it myself in production environments and have never had any issues with it. It's as easy to use as you'd expect:

$("input").datetimepicker();
new Date($("input").val());
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top