Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fullcalendar 使用“;h”;而不是“;:”;作为分隔符_Fullcalendar - Fatal编程技术网

Fullcalendar 使用“;h”;而不是“;:”;作为分隔符

Fullcalendar 使用“;h”;而不是“;:”;作为分隔符,fullcalendar,Fullcalendar,在法国,我们对时间使用以下24小时格式:18h30 因此,我想在FullCalendar 2的timeFormat选项中添加“h”字符。 我在这里找到了一个老帖子: 但解决方案显然不再适用于FullCalendar v2 有没有一种方法可以“转义”timeFormat选项中的“h”字符?您不能转义它,但是可以使用eventRender方法为您执行此操作 在呈现事件时,解析DOM并将:替换为h timeFormat: "H:mm", eventRen

在法国,我们对时间使用以下24小时格式:18h30

因此,我想在FullCalendar 2的timeFormat选项中添加“h”字符。 我在这里找到了一个老帖子: 但解决方案显然不再适用于FullCalendar v2


有没有一种方法可以“转义”timeFormat选项中的“h”字符?

您不能转义它,但是可以使用
eventRender
方法为您执行此操作

在呈现事件时,解析DOM并将:替换为h

            timeFormat: "H:mm",
            eventRender: function(event, element) {
                element.find('.fc-time').text(function () {
                    return $(this).text().replace(":", "h"); 
                });
            }

你不能逃避它,但是你可以使用
eventRender
方法来为你做这件事

在呈现事件时,解析DOM并将:替换为h

            timeFormat: "H:mm",
            eventRender: function(event, element) {
                element.find('.fc-time').text(function () {
                    return $(this).text().replace(":", "h"); 
                });
            }
Fullcalendar用于日期/时间

要转义格式字符串中的字符,可以将字符换行 方括号

moment().format(“[today]dddd”);/”今天周日’

这也适用于
formatTime
fullcalendar选项:

timeFormat: 'H[h](mm)'
完整日历用于日期/时间

要转义格式字符串中的字符,可以将字符换行 方括号

moment().format(“[today]dddd”);/”今天周日’

这也适用于
formatTime
fullcalendar选项:

timeFormat: 'H[h](mm)'

你肯定能逃脱,它使用momentjs。你肯定能逃脱,它使用momentjs。酷,我不知道。谢谢,酷,我不知道。谢谢