Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions js/utils/timestamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ o2.Utilities.phpToMoment = function( s ) {
var m = '';
var lookBehind = '';
for ( var i = 0; i < s.length; i++ ) {
if ( lookBehind === "\\" ) { // Escaping character
m += '[' + s.charAt( i ) + ']';
lookBehind = s.charAt( i );
continue;
}

switch ( s.charAt( i ) ) {
case 'd': // Day of the month with leading zeroes
m += 'DD';
Expand Down Expand Up @@ -106,6 +112,7 @@ o2.Utilities.phpToMoment = function( s ) {
case 'u': // Microseconds
case 'I': // Daylight savings time
case 'Z': // Timezone offset in seconds
case '\\': // Escaping character
break;

// Handle with lookBehind to handle 'jS'
Expand Down