UNPKG

dijit

Version:

Dijit provides a complete collection of user interface controls based on Dojo, giving you the power to create web applications that are highly optimized for usability, performance, internationalization, accessibility, but above all deliver an incredible u

63 lines (54 loc) 1.61 kB
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>_TimePicker DOH Test</title> <script type="text/javascript" src="boilerplate.js"></script> <script type="text/javascript"> require([ "doh/runner", "dojo/_base/declare", "dijit/_TimePicker", "dojo/domReady!" ], function(doh, declare, _TimePicker){ doh.register("tests", [ function extended_range(){ var t1 = _TimePicker({}, "t1"); t1.set('value', new Date("December 11, 2011 00:09:30")); doh.is(96, t1.timeMenu.children.length, 'num entries 1'); }, function constraints17250(){ var tp = new (declare(_TimePicker, { isDisabledDate: function () { return this.inherited(arguments); } }))(); tp.set('constraints', { constructor: null, clickableIncrement: 'T01:00:00', set: function () { throw new Error('Wrong set called'); } }); tp.set('value', new Date()); doh.is(24, tp.timeMenu.children.length, 'Increment constraints should be copied but other non-constraint properties should not'); }, function min_max(){ var tp = _TimePicker({ pickerMin: "T09:00:00", clickableIncrement: "T01:00:00", pickerMax: "T17:00:00" }); doh.is(9, tp.timeMenu.children.length, 'num entries'); } ]); doh.run(); }); </script> </head> <body> <h1 class="testTitle">dijit._TimePicker automated tests (non-robot)</h1> <label for="t1">t1:</label> <div id="t1" style="height: 200px; width: 150px; overflow: auto;"></div> </body> </html>