@@ -3,9 +3,11 @@ import * as html from './html';
33import * as list from './list' ;
44import * as moment from 'moment' ;
55import ComponentsList from './ComponentsList' ;
6+ import ComponentsArray from './ComponentsArray' ;
67import Event from './Event' ;
78import EventsForDay from './EventsForDay'
89import UiComponent from './UiComponent' ;
10+ import DayOff from './DayOff' ;
911
1012export default class EventsForCurrentPeriod implements UiComponent {
1113 constructor ( private _state : dto . State ) {
@@ -14,22 +16,15 @@ export default class EventsForCurrentPeriod implements UiComponent {
1416 appendTo ( entry : HTMLElement | null ) : void {
1517 let day = moment ( ) . clone ( ) . utc ( ) . startOf ( 'day' ) . subtract ( 2 , 'days' )
1618
17- let events = new list . ConcatLists (
18- new list . MappedList (
19- new list . ListOfNumbersRange ( 1 , 16 ) ,
20- ( _ , i ) => new EventsForDay (
21- this . _state ,
22- day . clone ( ) . add ( i , 'days' ) . format ( "YYYY-MM-DD" ) ,
23- )
24- ) . asArray ( )
25- ) ;
26-
2719 new html . Div (
2820 new ComponentsList (
29- new list . ConcatLists ( [
30- new list . SlicedList ( new list . FilteredList ( events , ( e ) => e . isPast ( ) ) , - 2 ) ,
31- new list . FilteredList ( events , ( e ) => ! e . isPast ( ) )
32- ] )
21+ new list . MappedList (
22+ new list . ListOfNumbersRange ( 1 , 16 ) ,
23+ ( _ , i ) => new EventsForDay (
24+ this . _state ,
25+ day . clone ( ) . add ( i , 'days' ) . format ( "YYYY-MM-DD" ) ,
26+ )
27+ )
3328 ) ,
3429 { "class" : "events" }
3530 ) . appendTo ( entry )
0 commit comments