datepicker icon indicating copy to clipboard operation
datepicker copied to clipboard

How to display the month names instead of number like I want to show Feb instead of 2

Open saadtanvir1994 opened this issue 4 years ago • 3 comments

saadtanvir1994 avatar Mar 19 '20 21:03 saadtanvir1994

where you want to display?mouth in select input value can not support

qiuyaofan avatar Mar 25 '20 15:03 qiuyaofan

No I want to display the month that are previewing in number like January is showing as 1 , February is showing as 2 , I want to be as January, Feburary not 1 , 2

saadtanvir1994 avatar Mar 25 '20 15:03 saadtanvir1994

Hi, i just looked into the js code (i am using datepicker.down.js) and there is a code like pickerHeaderTpl: function (nameOptions, className, prev, next, year, month) { var html = '<div class="' + className + '__header">' + prev + '<span role="button" class="' + className + '__header-label ' + className + '__header-year"><span>' + year + '</span> ' + nameOptions.headerYearLink + '</span>' + '<span role="button" class="' + className + '__header-label ' + className + '__header-month"><span>' + month + '</span> ' + nameOptions.units[1] + '</span>' + next + '</div>'; return html; } on the 377. lines. So here is a line with month (number) and units (do not know what is units!) '<span role="button" class="' + className + '__header-label ' + className + '__header-month"><span>' + month + '</span> ' + nameOptions.units[1] + '</span>' + and changed to: '<span role="button" class="' + className + '__header-label ' + className + '__header-month"><span>' + month + '</span> ' + nameOptions.months[month] + '</span>' + so it puts the month number and date name there :) Hope that helps you (but it is a little hard to configure i suppose) And of course you have to prepare your language javascript file and insert it into code and call the initializer like $('.J-datepicker-range-day').datePicker({ hasShortcut: true, format: 'YYYY-MM-DD', isRange: true, language: 'tr', etc.

umutbebek avatar Apr 17 '20 11:04 umutbebek