Skip to content

Commit e99cae4

Browse files
committed
Updated documentation
1 parent 1ab8c3f commit e99cae4

File tree

2 files changed

+49
-10
lines changed

2 files changed

+49
-10
lines changed

README.md

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Extension for converting between timezones in [Albert launcher](https://albertlauncher.github.io/)
88

9-
![image](https://user-images.githubusercontent.com/20955511/142168605-4e4badca-5693-4c4f-8f20-f03b8723c97f.png)
9+
![Peek 2021-11-17 14-36](https://user-images.githubusercontent.com/20955511/142286371-7257b05c-1d84-40f6-b5a0-079525fe4c4b.gif)
1010

1111
## Installation
1212

@@ -20,7 +20,7 @@ The data directories reside in the data directories of the application defined b
2020
/usr/share/albert/org.albert.extension.python/modules
2121
```
2222

23-
Double-clicking on a module in the settings will open the directory in the file manager.
23+
(Note: Double-clicking on a module in the settings will open the directory in the file manager.)
2424

2525
2. Clone this repository into your `modules` directory.
2626

@@ -30,13 +30,13 @@ cd /path/to/modules
3030
git clone https://github.com/DenverCoder1/timezone-convert-albert-ext.git
3131
```
3232

33-
3. Install `dateparser` using pip.
33+
3. Ensure that `dateparser` is installed using pip.
3434

3535
```bash
3636
python3 -m pip install dateparser
3737
```
3838

39-
4. Enable the extension in the settings.
39+
4. Enable the extension in the settings under `Extensions > Python`.
4040

4141
![settings](https://user-images.githubusercontent.com/20955511/142149401-188a865a-211e-4aa9-9e03-bf6314c2041e.png)
4242

@@ -50,18 +50,53 @@ Examples:
5050

5151
`8am MST in New York`
5252

53-
## Config
53+
You can also use "Time in..." to convert the current time to another timezone.
5454

55-
In `config.py` there are options to customize the extension:
55+
`Time in UTC`
5656

57-
### 24-hour time
57+
`Time in Tokyo`
5858

59-
To enable 24-hour time, set `hr24` to `True`.
59+
## Configuration
60+
61+
In `config.jsonc` there are options to customize the extension:
62+
63+
### Date format
64+
65+
To change the way dates are displayed, set the `date_format` option.
66+
67+
The default is `%a %d %b` (e.g. "Mon 12 Dec").
68+
69+
See https://strftime.org for a list of supported formats
70+
71+
### Time format
72+
73+
To change the way times are displayed, set the `time_format` option.
74+
75+
You can use `%H:%M` for 24-hour time, or `%I:%M %p` for 12-hour time.
76+
77+
The default is `%I:%M %p` (eg. "12:00 PM")
78+
79+
See https://strftime.org for a list of supported formats
80+
81+
### Remove leading zeros
82+
83+
Set `remove_leading_zeros` to true to remove leading zeros from the date/time.
84+
85+
Eg. `Mon 01 Dec 01:00 PM` becomes `Mon Dec 1 1:00 PM`.
86+
87+
The default is `true`.
88+
89+
### Lowercase AM/PM
90+
91+
Set `lowercase_am_pm` to replace 'AM'/'PM' with 'am'/'pm' in time formats.
92+
93+
The default is `true`.
6094

6195
### Timezone aliases
6296

63-
To add a city or abbreviation as an alias for a timezone, add it to `aliases` as a key-value pair.
97+
To add a city or abbreviation as an alias for a timezone, add it to `tz_aliases` as a key-value pair.
6498

99+
See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for a list of supported timezones
65100

66101

67102
## Contributing

config.jsonc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Date format
33
//
44
// %a = Weekday (eg. "Mon"), %d = Day (eg. "01"), %b = Month (eg. "Sep")
5+
// Default: "%a %d %b" (eg. "Mon 01 Sep")
56
//
67
// See https://strftime.org for a list of supported formats
78
"date_format": "%a %d %b",
@@ -13,14 +14,17 @@
1314
//
1415
// For 24-hour clock, "%H:%M"
1516
// For 12-hour clock, "%I:%M %p"
17+
// Default: "%I:%M %p" (eg. "12:00 PM")
1618
//
1719
// See https://strftime.org for a list of supported formats
1820
"time_format": "%I:%M %p",
1921

2022
// Remove leading zeros from dates and times
23+
// Default: true
2124
"remove_leading_zeros": true,
2225

23-
// Lowercase AM/PM - replace 'AM'/'PM' with 'am'/'pm' in time format
26+
// Lowercase AM/PM - replace 'AM'/'PM' with 'am'/'pm' in time formats
27+
// Default: true
2428
"lowercase_am_pm": true,
2529

2630
// Timezone aliases to replace when parsing.

0 commit comments

Comments
 (0)