create a date picker on a custom field sugarcrm 7

So I have a custom dashlet with a custom field and that custom field I would like to have the date picker show when I click on the field and when I pick a date the date is populating in that field.  It appears sugarcrm already has that setup in the system but using it appears a little tricky. I got as far as the code below but then this.view is undefined.  Everything else in my dashlet works except for setting up the datepicker on a custom field.  How do I go about doing that?  Help would be appreciated, thanks!
var $field = this.$('input[name=dashlet_pipeline_start_date]');
  $field.datepicker({     timeFormat: this.getUserTimeFormat(),     scrollDefaultNow: true,     step: 15,     className: 'prevent-mousedown',     appendTo: this.view.$el  });
Parents
  • Just IGNORE me.  Simply setting type="date", I'm using HTML5 technology to populate the date and I was calling a [0].focus() function on the element while datepicker was selected, that's why the cursor was stuck.  :-/  Man.  Well at least it's fixed, using HTML5 date picker works good for me in this case.  Thanks!
Reply
  • Just IGNORE me.  Simply setting type="date", I'm using HTML5 technology to populate the date and I was calling a [0].focus() function on the element while datepicker was selected, that's why the cursor was stuck.  :-/  Man.  Well at least it's fixed, using HTML5 date picker works good for me in this case.  Thanks!
Children
No Data