#2699 month name to number
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Related tickets | https://github.com/uxsolutions/bootstrap-datepicker/issues/2699 |
| License | MIT |
This is something that we require, is there any progress on this being completed?
This is something that we require, is there any progress on this being completed?
Hey, We have forked this repo and created our own solution. The feature to solve month name to number is here: https://github.com/marijusGood/bootstrap-datepicker/blob/83caeeeb1161fccbbdf259cd0874483ce3484081/dist/js/bootstrap-datepicker.js#L2018
I've added a new monthNameToNumber value that is False on default but if you specify it to be true just like any other parameter it will convert Feb feb February february to 2
hope this helps, let me know if you have more questions
PS: you can ignore afterInputChange that is something that we needed
most important line is:
if (isNaN(val)){
if (part === 'mm' && monthNameToNumber) {
filtered = $(dates[language].monthsShort).filter(match_part);
if (filtered[0] !== undefined) {
val = $.inArray(filtered[0], dates[language].monthsShort) + 1;