Skip to content

Commit

Permalink
v0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
inv2004 committed Jan 2, 2024
1 parent 376bfcf commit 91cfb96
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
Binary file modified .github/images/ccal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Calendar with local holidays via ip location

* Caches holidays and location in local cache folder
* Personal calendars
* Custom highlight [here](#custom-style)

![image](.github/images/ccal.png)

Expand All @@ -20,11 +22,28 @@ curl -LO https://github.com/inv2004/ccal/releases/latest/download/ccal \
nimble install ccal
```

### Custom style
`$HOME/.config/ccal/myevents.txt``
```
fgGreen
2024-01-05
2024-06-01
2024-07-01
2024-08-01
styleDim styleUnderscore
2024-06-02
2024-07-31
2024-08-17
```

* it mixes colors sometimes: if it is "red" holiday and your "green day" => yellow

## Usage
```bash
Usage:
ccal [year(s)] [country] year (or several) and country code
[country] [year(s)]
-p print personal days
--cleanup cleanup holidays cache
--version -v version
```
2 changes: 1 addition & 1 deletion ccal.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.4.1"
version = "0.4.2"
author = "inv2004"
description = "calendar with local holidays via ip location"
license = "MIT"
Expand Down
11 changes: 7 additions & 4 deletions src/ccal.nim
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,19 @@ proc personal(year = today().year): PDays =
dt = dateTime(year, dt.month, dt.monthday, zone = utc())
result[dt] = pday
except TimeParseError:
for str in l.split(' '):
var firstStyle = true
for str in l.splitWhitespace():
try:
let c = parseEnum[ForegroundColor](str) # TODO: Nim exception destructor error
pday.colors = {c}
except ValueError:
try:
if str == "styleReset":
pday.styles = {}
let style = parseEnum[Style](str)
if firstStyle:
pday.styles = {style}
firstStyle = false
else:
pday.styles.incl parseEnum[Style](str)
pday.styles.incl style
except ValueError:
stderr.write("Cannot parse: `", str, "` in ", f)
nl()
Expand Down

0 comments on commit 91cfb96

Please sign in to comment.