summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaulillo <36534958+r4ulill0@users.noreply.github.com>2023-05-27 08:50:07 +0200
committerChristian Geier <christian.geier@justadd.ai>2023-06-02 20:39:02 +0200
commitfea9f066bb0d243fe95ee2702d2bd9920e1f2d48 (patch)
tree14d9d5217d885bf8a5e087e0bd18bf93278245ba
parent032f97c58da104672467781070800941ad49692b (diff)
Implement minimum month display configuration pimutils/khal#1226
-rw-r--r--AUTHORS.txt1
-rw-r--r--CHANGELOG.rst2
-rw-r--r--khal/controllers.py2
-rw-r--r--khal/settings/khal.spec4
4 files changed, 8 insertions, 1 deletions
diff --git a/AUTHORS.txt b/AUTHORS.txt
index 44bdc67e..f95ca74b 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -50,3 +50,4 @@ Anuragh - kpanuragh [at] gmail [dot] com
Henning Ullrich - github {at] henning-ullrich [dot] de
Jason Cox - me [at] jasoncarloscox [dot] com - https://jasoncarloscox.com
Michael Tretter - michael.tretter [at] posteo [dot] net
+Raúl Medina - raulmgcontact [at] gmail (dot] com
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 48c1fb62..7b975827 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -14,6 +14,8 @@ not released yet
* FIX khal `at` also uses `event_format` not `agenda_event_format`
* FIX duplicating an event using `p` in ikhal
+* NEW Add ability to change the minimum number of months displayed with
+ `min_calendar_display`
0.11.1
======
diff --git a/khal/controllers.py b/khal/controllers.py
index b1434e0f..589f9cf6 100644
--- a/khal/controllers.py
+++ b/khal/controllers.py
@@ -114,7 +114,7 @@ def calendar(collection, agenda_format=None, notstarted=False, once=False, dater
calendar_column = calendar_display.vertical_month(
month=start.month,
year=start.year,
- count=max(3, (end.year - start.year) * 12 + end.month - start.month + 1),
+ count=max(conf['view']['min_calendar_display'], (end.year - start.year) * 12 + end.month - start.month + 1),
firstweekday=firstweekday, weeknumber=weeknumber,
monthdisplay=monthdisplay,
collection=collection,
diff --git a/khal/settings/khal.spec b/khal/settings/khal.spec
index be60a07c..789b103a 100644
--- a/khal/settings/khal.spec
+++ b/khal/settings/khal.spec
@@ -291,6 +291,10 @@ monthdisplay = monthdisplay(default='firstday')
# The syntax is the same as for :option:`--format`.
event_format = string(default='{calendar-color}{cancelled}{start}-{end} {title}{repeat-symbol}{alarm-symbol}{description-separator}{description}{reset}')
+# Minimum number of months displayed by calendar command
+# default is 3 months
+min_calendar_display = integer(default=3)
+
# When highlight_event_days is enabled, this section specifies how
# the highlighting/coloring of days is handled.
[highlight_days]