Closed Chaiyaboon-Sruayiam closed 1 year ago
@Chaiyaboon-Sruayiam I am currently working on a rewrite of the entire library (most options will stay the same) and I think this is a good idea - the ability to customize the year number. I forget what thread I saw it in, but I think the ability to also customize the day numbers should be available as well. I will add these.
@Chaiyaboon-Sruayiam What would you expect to happen on the overlay view where you can type in a year? Would you expect to type in 2562 and under the hood datepicker knows it is 2019? (I'm using your initial example)
I'm going to provide an unformatYear
option that the user can provide to convert the user's year input on the overlay screen (i.e. 2562) to a number that JavaScript dates can consume (i.e. 2019).
For reference, here's the options you'll want to use that will be available in the upcoming rewrite of datepicker:
formatYear
- a function that receives a number (i.e. a date.getFullYear()) and should return a string, formatted however you'd like.formatDay
- a function that receives a number and should return a string, formatted however you'd like.unformatYear
- a function that receives a string and should return a number that can be consumed by the JavaScript Date constructor.
Can I customize year number that is on calendar picker? Or can you add more customizable config such as "yearDisplayOffset" and default value of "yearDisplayOffset" is 0 or function to manipulate year number before display or somethings like that.
Thank you.