File tree Expand file tree Collapse file tree 16 files changed +278
-2
lines changed
Expand file tree Collapse file tree 16 files changed +278
-2
lines changed Original file line number Diff line number Diff line change 9696 return {
9797 restrict : 'E' ,
9898 require : 'ngModel' ,
99- template : '<div class="datetimepicker table-responsive">' +
99+ template : '<div class="datetimepicker table-responsive {{data.currentView}}-view ">' +
100100 '<table class="table table-striped">' +
101101 ' <thead>' +
102102 ' <tr>' +
Original file line number Diff line number Diff line change 1212 * @since 7/21/13
1313 */
1414
15+ describe ( 'current view displayed on the markup' , function ( ) {
16+ 'use strict' ;
17+
18+ var $rootScope , element ;
19+
20+ beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
21+ beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
22+ moment . locale ( 'de' ) ;
23+ $rootScope = _$rootScope_ ;
24+ $rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
25+ element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'day\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
26+ $rootScope . $digest ( ) ;
27+ } ) ) ;
28+
29+ it ( 'should have `.day-view` class' , function ( ) {
30+ expect ( jQuery ( element ) . hasClass ( 'day-view' ) ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
33+
1534describe ( 'German day view with initial date of 2013-01-22' , function ( ) {
1635 'use strict' ;
1736 var $rootScope , element ;
Original file line number Diff line number Diff line change 1212 * @since 7/21/13
1313 */
1414
15+ describe ( 'current view displayed on the markup' , function ( ) {
16+ 'use strict' ;
17+
18+ var $rootScope , element ;
19+
20+ beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
21+ beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
22+ moment . locale ( 'de' ) ;
23+ $rootScope = _$rootScope_ ;
24+ $rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
25+ element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'hour\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
26+ $rootScope . $digest ( ) ;
27+ } ) ) ;
28+
29+ it ( 'should have `.hour-view` class' , function ( ) {
30+ expect ( jQuery ( element ) . hasClass ( 'hour-view' ) ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
1533
1634describe ( 'hour view with initial date of 2013-01-22' , function ( ) {
1735 'use strict' ;
Original file line number Diff line number Diff line change 1212 * @since 7/21/13
1313 */
1414
15+ describe ( 'current view displayed on the markup' , function ( ) {
16+ 'use strict' ;
17+
18+ var $rootScope , element ;
19+
20+ beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
21+ beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
22+ moment . locale ( 'de' ) ;
23+ $rootScope = _$rootScope_ ;
24+ $rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
25+ element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'minute\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
26+ $rootScope . $digest ( ) ;
27+ } ) ) ;
28+
29+ it ( 'should have `.minute-view` class' , function ( ) {
30+ expect ( jQuery ( element ) . hasClass ( 'minute-view' ) ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
1533
1634describe ( 'minute view with initial date of 2013-01-22 0:00' , function ( ) {
1735 'use strict' ;
Original file line number Diff line number Diff line change 1212 * @since 7/21/13
1313 */
1414
15+ describe ( 'current view displayed on the markup' , function ( ) {
16+ 'use strict' ;
17+
18+ var $rootScope , element ;
19+
20+ beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
21+ beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
22+ moment . locale ( 'de' ) ;
23+ $rootScope = _$rootScope_ ;
24+ $rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
25+ element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'month\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
26+ $rootScope . $digest ( ) ;
27+ } ) ) ;
28+
29+ it ( 'should have `.month-view` class' , function ( ) {
30+ expect ( jQuery ( element ) . hasClass ( 'month-view' ) ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
1533
1634describe ( 'month view with initial date of 2010-10-01' , function ( ) {
1735 'use strict' ;
Original file line number Diff line number Diff line change 1212 * @since 7/21/13
1313 */
1414
15+ describe ( 'current view displayed on the markup' , function ( ) {
16+ 'use strict' ;
17+
18+ var $rootScope , element ;
19+
20+ beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
21+ beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
22+ moment . locale ( 'de' ) ;
23+ $rootScope = _$rootScope_ ;
24+ $rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
25+ element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'year\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
26+ $rootScope . $digest ( ) ;
27+ } ) ) ;
28+
29+ it ( 'should have `.year-view` class' , function ( ) {
30+ expect ( jQuery ( element ) . hasClass ( 'year-view' ) ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
33+
1534describe ( 'year view with ng-model = null' , function ( ) {
1635 'use strict' ;
1736 var $rootScope , $compile , element ;
Original file line number Diff line number Diff line change 1212 * @since 7/21/13
1313 */
1414
15+ describe ( 'current view displayed on the markup' , function ( ) {
16+ 'use strict' ;
17+
18+ var $rootScope , element ;
19+
20+ beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
21+ beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
22+ moment . locale ( 'en' ) ;
23+ $rootScope = _$rootScope_ ;
24+ $rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
25+ element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'day\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
26+ $rootScope . $digest ( ) ;
27+ } ) ) ;
28+
29+ it ( 'should have `.day-view` class' , function ( ) {
30+ expect ( jQuery ( element ) . hasClass ( 'day-view' ) ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
33+
1534describe ( 'English day view with initial date of 2013-01-22' , function ( ) {
1635 'use strict' ;
1736 var $rootScope , element ;
Original file line number Diff line number Diff line change 1212 * @since 7/21/13
1313 */
1414
15+ describe ( 'current view displayed on the markup' , function ( ) {
16+ 'use strict' ;
17+
18+ var $rootScope , element ;
19+
20+ beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
21+ beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
22+ moment . locale ( 'en' ) ;
23+ $rootScope = _$rootScope_ ;
24+ $rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
25+ element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'hour\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
26+ $rootScope . $digest ( ) ;
27+ } ) ) ;
28+
29+ it ( 'should have `.hour-view` class' , function ( ) {
30+ expect ( jQuery ( element ) . hasClass ( 'hour-view' ) ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
1533
1634describe ( 'hour view with initial date of 2013-01-22' , function ( ) {
1735 'use strict' ;
Original file line number Diff line number Diff line change 1212 * @since 7/21/13
1313 */
1414
15+ describe ( 'current view displayed on the markup' , function ( ) {
16+ 'use strict' ;
17+
18+ var $rootScope , element ;
19+
20+ beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
21+ beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
22+ moment . locale ( 'en' ) ;
23+ $rootScope = _$rootScope_ ;
24+ $rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
25+ element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'minute\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
26+ $rootScope . $digest ( ) ;
27+ } ) ) ;
28+
29+ it ( 'should have `.minute-view` class' , function ( ) {
30+ expect ( jQuery ( element ) . hasClass ( 'minute-view' ) ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
1533
1634describe ( 'minute view with initial date of 2013-01-22 0:00' , function ( ) {
1735 'use strict' ;
Original file line number Diff line number Diff line change 1212 * @since 7/21/13
1313 */
1414
15+ describe ( 'current view displayed on the markup' , function ( ) {
16+ 'use strict' ;
17+
18+ var $rootScope , element ;
19+
20+ beforeEach ( module ( 'ui.bootstrap.datetimepicker' ) ) ;
21+ beforeEach ( inject ( function ( _$compile_ , _$rootScope_ ) {
22+ moment . locale ( 'en' ) ;
23+ $rootScope = _$rootScope_ ;
24+ $rootScope . date = moment ( '2013-01-22T00:00:00.000' ) . toDate ( ) ;
25+ element = _$compile_ ( '<datetimepicker data-datetimepicker-config="{ startView: \'month\'}" data-ng-model="date"></datetimepicker>' ) ( $rootScope ) ;
26+ $rootScope . $digest ( ) ;
27+ } ) ) ;
28+
29+ it ( 'should have `.month-view` class' , function ( ) {
30+ expect ( jQuery ( element ) . hasClass ( 'month-view' ) ) . toBeTruthy ( ) ;
31+ } ) ;
32+ } ) ;
1533
1634describe ( 'month view with initial date of 2010-10-01' , function ( ) {
1735 'use strict' ;
You can’t perform that action at this time.
0 commit comments