added calendar slot_duration config (#989)
This commit is contained in:
@@ -124,6 +124,7 @@ kimai:
|
||||
# week_numbers: true
|
||||
# weekends: true
|
||||
# day_limit: 4
|
||||
# slot_duration: '00:30:00'
|
||||
# businessHours:
|
||||
# days: [1, 2, 3, 4, 5]
|
||||
# begin: '08:00'
|
||||
|
||||
@@ -97,4 +97,9 @@ class CalendarConfiguration implements SystemBundleConfiguration
|
||||
{
|
||||
return $this->find('google.sources');
|
||||
}
|
||||
|
||||
public function getSlotDuration(): string
|
||||
{
|
||||
return (string) $this->find('slot_duration');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +250,7 @@ class Configuration implements ConfigurationInterface
|
||||
->children()
|
||||
->booleanNode('week_numbers')->defaultTrue()->end()
|
||||
->integerNode('day_limit')->defaultValue(4)->end()
|
||||
->scalarNode('slot_duration')->defaultValue('00:30:00')->end()
|
||||
->arrayNode('businessHours')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
|
||||
@@ -215,9 +215,8 @@
|
||||
eventResize: changeHandler,
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
/*
|
||||
slotDuration: '00:30:00', // TODO make me configurable
|
||||
*/
|
||||
slotDuration: '{{ config.slotDuration }}',
|
||||
slotLabelInterval: '{{ config.slotDuration }}',
|
||||
minTime: '{{ config.timeframeBegin }}',
|
||||
maxTime: '{{ config.timeframeEnd }}',
|
||||
defaultTimedEventDuration: '00:30'
|
||||
|
||||
@@ -42,6 +42,7 @@ class CalendarConfigurationTest extends TestCase
|
||||
'end' => '19:27'
|
||||
],
|
||||
'day_limit' => 20,
|
||||
'slot_duration' => '01:11:00',
|
||||
'week_numbers' => false,
|
||||
'google' => [
|
||||
'api_key' => 'wertwertwegsdfbdf243w567fg8ihuon',
|
||||
@@ -72,6 +73,7 @@ class CalendarConfigurationTest extends TestCase
|
||||
$this->assertEquals([2, 4, 6], $sut->getBusinessDays());
|
||||
$this->assertEquals('07:49', $sut->getBusinessTimeBegin());
|
||||
$this->assertEquals('19:27', $sut->getBusinessTimeEnd());
|
||||
$this->assertEquals('01:11:00', $sut->getSlotDuration());
|
||||
$this->assertEquals(20, $sut->getDayLimit());
|
||||
$this->assertFalse($sut->isShowWeekNumbers());
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ class CalendarControllerTest extends ControllerBaseTest
|
||||
],
|
||||
'day_limit' => 20,
|
||||
'week_numbers' => false,
|
||||
'slot_duration' => '00:15:00',
|
||||
'google' => [
|
||||
'api_key' => 'wertwertwegsdfbdf243w567fg8ihuon',
|
||||
'sources' => [
|
||||
|
||||
@@ -63,6 +63,7 @@ class AppExtensionTest extends TestCase
|
||||
'kimai.calendar' => [
|
||||
'week_numbers' => true,
|
||||
'day_limit' => 4,
|
||||
'slot_duration' => '00:30:00',
|
||||
'businessHours' => [
|
||||
'days' => [1, 2, 3, 4, 5],
|
||||
'begin' => '08:00',
|
||||
|
||||
Reference in New Issue
Block a user