mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #25006 -- Allowed custom time shortcuts in admin's time picker.
This commit is contained in:
committed by
Tim Graham
parent
5b6181f4d5
commit
385cf7091e
@@ -21,3 +21,12 @@ QUnit.test('init', function(assert) {
|
||||
// should be 0 when a timezone offset isn't set in the HTML body attribute.
|
||||
assert.equal(DateTimeShortcuts.timezoneOffset, 0);
|
||||
});
|
||||
|
||||
QUnit.test('custom time shortcuts', function(assert) {
|
||||
var $ = django.jQuery;
|
||||
var timeField = $('<input type="text" name="time_test" class="vTimeField">');
|
||||
$('#qunit-fixture').append(timeField);
|
||||
DateTimeShortcuts.clockHours.time_test = [['3 a.m.', 3]];
|
||||
DateTimeShortcuts.init();
|
||||
assert.equal($('.clockbox').find('a').first().text(), '3 a.m.');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user