mirror of
https://github.com/samsonjs/strftime.git
synced 2026-03-25 09:05:48 +00:00
Consistency with existing code
Add test for unrecognized directives to test.js. Add braces around if statement.
This commit is contained in:
parent
58f5c3fee8
commit
f5bb098221
2 changed files with 4 additions and 2 deletions
|
|
@ -500,8 +500,9 @@
|
|||
break;
|
||||
|
||||
default:
|
||||
if (isInScope)
|
||||
if (isInScope) {
|
||||
resultString += '%';
|
||||
}
|
||||
resultString += format[i];
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
3
test.js
3
test.js
|
|
@ -121,7 +121,8 @@ assert.format('%y', '11');
|
|||
assert.format('%Z', null, 'GMT');
|
||||
assert.format('%z', null, '+0000');
|
||||
assert.format('%:z', null, '+00:00');
|
||||
assert.format('%%', '%'); // any other char
|
||||
assert.format('%%', '%'); // literal percent sign
|
||||
assert.format('%g', '%g'); // unrecognized directive
|
||||
assert.format('%F %T', null, '1970-01-01 00:00:00', new Date(0));
|
||||
assert.format('%U', null, '12', new Date('2017-03-25 00:00:00 +0000'));
|
||||
assert.format('%U', null, '13', new Date('2017-03-26 00:00:00 +0000'));
|
||||
|
|
|
|||
Loading…
Reference in a new issue