Skip to content

Commit 072e6a5

Browse files
authored
Support escaped characters in the date format (#227)
1 parent f8b2344 commit 072e6a5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

js/utils/timestamp.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ o2.Utilities.phpToMoment = function( s ) {
112112
case 'j': // Day of the month without leading zeroes
113113
break;
114114

115+
// Handle PHP escaping
116+
case '\\':
117+
m += '[' + s.charAt( ++i ) + ']';
118+
break;
119+
115120
default:
116121
if ( lookBehind === 'j' && s.charAt( i ) !== 'S' ) {
117122
m += 'D[' + s.charAt( i ) + ']';

0 commit comments

Comments
 (0)