EasyUI Forum
May 17, 2024, 10:06:04 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datetime box today button  (Read 5507 times)
itay-g
Newbie
*
Posts: 35


View Profile
« on: May 04, 2014, 04:41:24 AM »

hey
i need the today button to set not only the current day also the current hour and minutes
how can i do it?
is there an event of today button click that i can override?

thnx!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 04, 2014, 07:39:09 AM »

You can override the $.fn.datetimebox.defaults.buttons to custom their behaviors.
Code:
<script type="text/javascript">
$.fn.datetimebox.defaults.buttons[0] = {
text: function(target){return $(target).datetimebox('options').currentText;},
handler: function(target){
var opts = $(target).datetimebox('options');
$(target).datetimebox('setValue', opts.formatter.call(target, new Date()));
$(target).datetimebox('hidePanel');
}

}
</script>
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!