在 datepicker.js 中将 AM/PM 转换为小写?

Convert AM/PM to lowercase in datepicker.js?

pickadatejs中,是否有可能获得小写格式(am/pm)而不是大写格式(AM/PM),尽可能少的配置?

来自文档:

The formatLabel option is unique. It can contain HTML and it can also be a function if you want to create the label during run-time:

$('.timepicker').pickatime({
  // Escape any “rule” characters with an exclamation mark (!).
  format: 'T!ime selected: h:i a',
  formatLabel: '<b>h</b>:i <!i>a</!i>',
  formatSubmit: 'HH:i',
  hiddenPrefix: 'prefix__',
  hiddenSuffix: '__suffix'
})

在 formatLabel 中,您可以简单地使用 .toLowerCase(),因为它接受一个函数。