altFormat

19 views
Skip to first unread message

Alex Mourer

unread,
Nov 21, 2013, 6:24:01 PM11/21/13
to mobis...@googlegroups.com
Does mobiscroll support an altfield function similar to jQuery Datepicker's altFormat? http://api.jqueryui.com/datepicker/#option-altFormat

My end goal is to have the user select and see one date format but an alternate format is sent as the real value.

Istvan Halmen

unread,
Nov 22, 2013, 4:57:29 AM11/22/13
to Mobiscroll Group
Hi Alex,

As I see you got your answer on the google groups, is that right?

Cheers,
Istvan


On Fri, Nov 22, 2013 at 1:24 AM, Alex Mourer <al...@alexmourer.com> wrote:
Does mobiscroll support an altfield function similar to jQuery Datepicker's altFormat? http://api.jqueryui.com/datepicker/#option-altFormat

My end goal is to have the user select and see one date format but an alternate format is sent as the real value.

--
You received this message because you are subscribed to the Google Groups "Mobiscroll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobiscroll+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alex Mourer

unread,
Nov 22, 2013, 12:31:48 PM11/22/13
to mobis...@googlegroups.com
Not quite. I think your example here is getting me on the right track but doesn't really accomplish what I'm trying to do.


$('#test').scroller{

      preset:            'date',
      mode:             'clickpick',
      dateFormat:    'yy-mm-dd',
      dateOrder:      'yymmdd',
      headerTextfunction(d{
          return $.scroller.formatDate('d MM yy'$(this).scroller('getDate'));
      }
   });

I don't want my user to ever see my secondary date/time format. If possible I'd like to populate a hidden input field with the secondary format.

Istvan Halmen

unread,
Nov 26, 2013, 7:47:19 AM11/26/13
to Mobiscroll Group
Hi Alex,

You can do that in the onSelect function:

$('#test').mobiscroll().date({
      mode: 'clickpick',
      dateFormat: 'd MM yy',
      dateOrder: 'yymmdd',
      onSelect: function(valueText, inst) {
          $('#hidenfield').val($.mobiscroll.formatDate('yy-mm-dd', inst.getDate()));
      }
 });


Regards,
Istvan

Reply all
Reply to author
Forward
0 new messages