BaseFuelController.js can i detect application language?

in BaseFuelController.js i want to change date format but i would like to know which language is used.

If is english i will use:

_initDatePicker : function(context){ // set up any date fields Date.format = 'mm1/dd/yyyy'; Date.firstDayOfWeek = 0; $('.datepicker', context).fillin('mm/dd/yyyy');

else i will use:

_initDatePicker : function(context){ // set up any date fields Date.format = 'dd.mm.yyyy'; Date.firstDayOfWeek = 0; $('.datepicker', context).fillin('dd.mm.yyyy');

Can I in BaseFuelController.js detect application language?

Comments

  • edited 7:40AM
    There currently isn't a javascript language variable used by BaseFuelController (e.g. jqx.config.lang). Perhaps you could create a hidden field in your model's form_fields method that could be accessed by the javascript:
    _initDatePicker : function(context){ // set up any date fields $df = $('#date_format').val(); if (!$df) $df = 'mm/dd/yyyy'; Date.format = $df; $('.datepicker', context).fillin($df); ....
Sign In or Register to comment.