向 ExtJS 添加新的日期格式

Adding new date formats to ExtJS

Ext.Date 分别包含 am/pm 或 AM/PM 的格式 aA

我想添加一种格式,将其命名为 b,因为 a/p 没有 m。我搜索了 parseFunctions 和 formatFunctions 但没有找到旧格式的定义位置。

谁能解释一下这个问题?

看看 Ext.Date 中的 formatCodes:

The base format-code to formatting-function hashmap used by the format method. Formatting functions are strings (or functions which return strings) which will return the appropriate value when evaluated in the context of the Date object from which the format method is called. Add to / override these mappings for custom date formatting.