Skip to content

Commit 43f3040

Browse files
committed
Test the literal handling in formatTime() a little more and fix a warning and a curious behavior.
1 parent 361eb77 commit 43f3040

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@
13131313
case 'tt':
13141314
return ampmName.toLowerCase();
13151315
default:
1316-
return match.replace(/\'/g, "") || "'";
1316+
return match.replace(/'/g, "");
13171317
}
13181318
});
13191319

test/jquery-ui-timepicker-addon_spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,9 @@ describe('datetimepicker', function() {
593593
expect($.datepicker.formatTime('')).toBe('');
594594
expect($.datepicker.formatTime("'abc'")).toBe('abc');
595595
expect($.datepicker.formatTime('"abc"')).toBe('"abc"');
596-
expect($.datepicker.formatTime("'")).toBe("'"); // TODO: Why???
596+
expect($.datepicker.formatTime("'")).toBe("'");
597+
expect($.datepicker.formatTime("''")).toBe("");
598+
expect($.datepicker.formatTime("'abc' h 'def'")).toBe('abc 12 def');
597599
});
598600
});
599601
});

0 commit comments

Comments
 (0)