Skip to content

%k failure at midnight #5

@dirkf

Description

@dirkf

The %k format can escape if nHour === 0 as 0 || '' => ''. It needs to be stringified. This is a simple fix:
#4

But maybe there are other formats where this applies? Any format expression that returns a number that could be 0, '' or any other falsy value needs to be stringified.

Instead why not have

 function(sMatch) {
            var fmt={
                '%a': aDays[nDay].slice(0,3),
                ...
                '%Z': date.toTimeString().replace(/.+\((.+?)\)$/, '$1')
            }[sMatch];
            if (typeof(fmt) === undefined) fmt = sMatch;
            return fmt +'';
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions