• Resolved zbubicic

    (@zbubicic)


    Please can you help about seting multilanguage datepicker. Thanx Zeljko

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    Do you want to change the language of the datepickers? If so, sorry this is not configurable yet but you could change its language easily by tweaking one file, please go to the file smart-forms\js\rednao-isolated-jq.js and look for the word ‘jan’ you will find something like this

    onthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}

    Here you can change the text for whatever you want.

    Hope this helps but if it doesn’t please let me know!

    Thread Starter zbubicic

    (@zbubicic)

    Thanx
    I read about that here in forum but I need help about where and how handling languages when it is changed or initialized in web browser.

    For example maybe I can add something like that:

    	 this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],
    		this.regional["hr"]={
    		 closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",
    		 monthNames:["Sije?anj","Velja?a","O?ujak","April","May","June","July","August","September","October","November","December"],
    		 monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
    		 dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
    		 dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
    		 dayNamesMin:["Ne","Po","Ut","We","Th","Fr","Sa"],
    		 weekHeader:"Wk",
    		 dateFormat:"mm/dd/yy",
    		 firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""			
    		}
    		this.regional[""]={
    		 closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",
    		 monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],
    		 monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
    		 dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
    		 dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
    		 dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],
    		 weekHeader:"Wk",
    		 dateFormat:"mm/dd/yy",
    		 firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""
    		}

    and than somewhere do sometihng like:

    if(document.documentElement.lang=="en-US"){
        datepicker.setDefaults($.datepicker.regional['hr-HR']);
    }

    or have more .js files for each language and handling them depands of choosen language?

    Thanx ZB

    • This reply was modified 6 years, 2 months ago by zbubicic.
    Plugin Author EDGARROJAS

    (@edgarrojas)

    Oh got it, to change the month names with javascript try something like this:

    rnJQuery(‘.redNaoDatePicker’).datepicker(‘option’,’monthNames’,[‘Ene’,’Feb’,’Mar’,’Abr’,’May’,’Jun’,’Jul’,’Ago’,’Sep’,’Oct’,’Nov’,’Dic’])

    And to change the day names try this:

    rnJQuery(‘.redNaoDatePicker’).datepicker(‘option’,’dayNamesMin’,[‘Dom’,’Lun’,’Mar’,’Mie’,’Jue’,’Vie’,’Sab’]);

    Regards!

    Thread Starter zbubicic

    (@zbubicic)

    Thanx. That is great.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Datepicker MultiLanguage’ is closed to new replies.