Compare commits

...

2 commits

2 changed files with 40 additions and 4 deletions

View file

@ -70,6 +70,12 @@ namespace _dali.widgets
);
/**
* [setting]
*/
private show_begin_time : boolean;
/**
* [state]
*/
@ -119,6 +125,7 @@ namespace _dali.widgets
{
"action_select_day": action_select_day = ((date) => {}),
"action_select_event": action_select_event = ((event_key) => {}),
"show_begin_time": show_begin_time = true,
"vertical": vertical = false,
"initial_year": initial_year = null,
"initial_week": initial_week = null,
@ -140,6 +147,7 @@ namespace _dali.widgets
=>
void
);
show_begin_time ?: boolean;
vertical ?: boolean;
initial_year ?: (null | int);
initial_week ?: (null | int);
@ -156,6 +164,9 @@ namespace _dali.widgets
this.action_select_day = action_select_day;
this.action_select_event = action_select_event;
// settings
this.show_begin_time = show_begin_time;
// state
const ywd_now : lib_plankton.pit.type_ywd = lib_plankton.pit.to_ywd(lib_plankton.pit.now());
this.vertical = vertical;
@ -349,8 +360,8 @@ namespace _dali.widgets
);
entries.sort(
(entry1, entry2) => {
const b1 : string = lib_plankton.pit.datetime_format(entry1.event_object.begin);
const b2 : string = lib_plankton.pit.datetime_format(entry2.event_object.begin);
const b1 : lib_plankton.pit.type_pit = lib_plankton.pit.from_datetime(entry1.event_object.begin);
const b2 : lib_plankton.pit.type_pit = lib_plankton.pit.from_datetime(entry2.event_object.begin);
return ((b1 <= b2) ? -1 : +1);
}
);
@ -389,7 +400,32 @@ namespace _dali.widgets
"tableview-cell-entry",
{
"color": _dali.helpers.event_color(entry.hue),
"name": entry.event_object.name,
"content": lib_plankton.string.coin(
(
(
this.show_begin_time
&&
(entry.event_object.begin.time === null)
)
?
"{{name}}"
:
"{{begin}} | {{name}}"
),
{
"begin": (
(entry.event_object.begin.time === null)
?
null
:
lib_plankton.pit.time_format(
entry.event_object.begin.time,
{"show_seconds": false}
)
),
"name": entry.event_object.name,
}
),
"rel": entry.key,
"additional_classes": lib_plankton.string.coin(
" access_level-{{access_level}}",

View file

@ -1,3 +1,3 @@
<li class="weekview-event_entry{{additional_classes}}" style="background-color: {{color}};" rel="{{rel}}">
{{name}}
{{content}}
</li>