Sublime Forum

ST3: QuickCal

#1

For ST3 only. A simple calendar viewing plugin.

Example keymap:
[pre=#2D2D2D] //////////////////////////////////////////////////////////////
// Calendar Shortcuts
//////////////////////////////////////////////////////////////
{
“keys”: “ctrl+super+alt+c”],
“command”: “calendar”
},
{
“keys”: “ctrl+super+alt+shift+c”],
“command”: “calendar_lookup”
},
{
“keys”: “alt+right”],
“command”: “calendar_month_nav”,
“context”:

        {
            "key": "calendar_view"
        }
    ],
    "args": {"reverse": false}
},
{
    "keys": "alt+left"],
    "command": "calendar_month_nav",
    "context":
    
        {
            "key": "calendar_view"
        }
    ],
    "args": {"reverse": true}
},[/pre]

I add this to my color scheme file to highlight holidays and the current selected day.

[pre=#2D2D2D]
name
Calendar Selected Day
scope
selected_day
settings

foreground
#2D2D2D
background
#F2777A



name
Calendar Holiday
scope
holiday
settings

foreground
#2D2D2D
background
#66CCCC

[/pre]

Holidays currently provided by holidata.net…so if its missing a holiday for your local, don’t gripe to me. In the future, I may add support for importing stuff like ical, but not right now.

Repo: github.com/facelessuser/QuickCal

Edit: repo link fixed

0 Likes

#2

Small workaround for OSX due to a missing urllib. If urllib fails, the plugin will try and use “curl” via subprocess to try and download the holiday list from holidata.net.

0 Likes

#3

Documentation is now available via the repo.

local settings was changed to be properly called locale; so just revisit your User settings file and update if your locale is suddenly wrong. All issues should be resolved. This is kind of a low priority repo for me in regards to updates (it works well enough for me as is), so if you really want feature X etc., please consider doing a pull request…and please make features optional.

0 Likes

#4

Quick tip:
Since holidata.net provide their data in utf-8 and it’s the only available source at this point you should make sure the data is read as utf-8. Language can be such a bit*h.

in “quickcal.py” @ line 99

From:

            with open(holiday_list, 'r') as f:

To

            with open(holiday_list, 'r', encoding='utf-8') as f:

KonTrax

0 Likes

#5

You got a point there @KonTrax :smile:. UTF8 fix is in.

0 Likes

#6

Thanks @facelessuser, this is great! Sorry I didn’t post sooner, I’ve been using this all week.

Thanks again,
Alex

0 Likes

#7

I’ll give it a try at next monday.

But the first feature request in mind: Can you add the calendar weeks?

And, I think that’s a bit bigger, calendars by using ical format? Like google, facebook, … You can configure the urls and the plugin will download and cache them in a file?

0 Likes

#8

What do you mean…like just a single week view?

It has been on my list, but FWIW the current calendar is more than sufficient. I really just wanted a way to look at a month from my editor (where I am most of the day at work). This is why ical hasn’t really been a priority for me. I added the holidata mainly because it was quick and easy. This kind of goes hand in hand possibly with your previous request of the calendar week…until I really support ical, it isn’t really like you can view your agenda on it, but that wasn’t initially the point of it of QuickCal. But like I said, it is on my list to implement, but I cannot promise when I will actually get around to it.

0 Likes

#9

By calendar week I mean the number of each calendar week.
Not another view for just one week. E.g. the current calendar week is 25 in germany. I’ve to look up the calendar week very often at my daily work and I don’t like to leave the ditor for that. I think that should not be that hard to add.

By iCal I meant en.wikipedia.org/wiki/ICalendar the format. So not just apple fans can use there data, but everyone who has a url.
You can share a Google Calendar, facebook events, etc. via a simple URL in this format. So by adding the URL to the config you can parse the data and show it inside the calendar. I don’t know how complicated that will be.

0 Likes

#10

Ahh, I see what you mean, that shouldn’t be hard. I’ll make a note of this and implement it when I get a chance.

I knew what you meant :smile:. I have already looked into the format earlier, but I haven’t gotten around to writing a parser (or finding a parser) and adding in the logic.

0 Likes

#11

The extension “Calendar Week” from the Package Control can show the current calendar week.

0 Likes

#12

Yeah nice, but would be nicer if it’s integrated into the calendar view as I often need to know when e.g. is CW 25.
We have deadlines for calendar weeks and I’ve to look up when this calendar week is.

BTW: Does it support the german / english differences? In germany the week starts at monday. Or does python use the system time and respect the settings?

0 Likes

#13

You just change this setting.
[pre=#141414] // Start with Sunday first when displaying calendar
“sunday_first”: true[/pre]

0 Likes

#14

I should have week number support in tonight. The code is in locally; I just need to verify later today that it properly uses ISO/Europe week numbers and US week numbers appropriately.

When Monday is first in the week it will use ISO/Europe week numbers. When Sunday is first, it will use US week numbers.

0 Likes

#15

Meh…I went ahead and pushed the calendar week changes. I think it works fine from my limited testing. If there is a problem, just report it. I don’t really have time to fool with it today, but it shouldn’t break anything even if it is off.

0 Likes

#16

Yes thanks. Works pretty well. Even with german cw

"sunday_first": false
0 Likes

#17

I need to fix US weeks. I also need to fix an issue where the month is displaying extra days…man, can’t believe I missed it. It is even doing it in the demo screenshot.

0 Likes

#18

US weeks numbers should be correct now.

Too many days in a month should also be fixed now. It was a Python 3 issue, but it is good now.

0 Likes