Skip to content

Commit f46683c

Browse files
committed
Preserve leading and trailing whitespace. Don't second guess the developer who specified whitespace in their format.
1 parent d787f15 commit f46683c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,6 @@
13171317
}
13181318
});
13191319

1320-
tmptime = $.trim(tmptime);
13211320
return tmptime;
13221321
};
13231322

test/jquery-ui-timepicker-addon_spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,16 @@ describe('datetimepicker', function() {
636636
});
637637
});
638638
});
639+
640+
describe('preserves whitespace in formats', function() {
641+
it('preserves leading whitespace', function() {
642+
expect($.datepicker.formatTime(' H', {hour: 3})).toBe(' 3');
643+
});
644+
645+
it('preserves trailing whitespace', function() {
646+
expect($.datepicker.formatTime('H ', {hour: 3})).toBe('3 ');
647+
});
648+
});
639649
});
640650
});
641651
});

0 commit comments

Comments
 (0)