I got a problem from format datetime of bootstrap datepicker. I want to covert datetime to format: 2021(R3)/11
This is my config:
$('.datepicker').datepicker({
format: {
toDisplay: function (date, format, language) {
var d = new Date(date);
const year = d.getFullYear()
const month = ('0' + (date.getMonth() + 1)).slice(-2);
const era = getEra(date)
return `${year}(${era})/${month}`;
},
toValue: function (date, format, language) {
return new Date(date);
}
}})
But there something make ${era} variable disappear in result:
[Result when change data][1] [1]: https://i.stack.imgur.com/mmhIb.png
It's look like round brackets been detected by something and remove every thing inside.
Have you guy have any idea ?
P/S: getEra(...) just return string