<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Stephan Meijer on Medium]]></title>
        <description><![CDATA[Stories by Stephan Meijer on Medium]]></description>
        <link>https://medium.com/@stephanmeijer?source=rss-234e8b28ff9c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mVZ97zj4W5zu3HH7-l8Xrg.jpeg</url>
            <title>Stories by Stephan Meijer on Medium</title>
            <link>https://medium.com/@stephanmeijer?source=rss-234e8b28ff9c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 18:57:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stephanmeijer/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Apostolos: bringing the Good Word of proper Time Tracking]]></title>
            <link>https://medium.com/@stephanmeijer/apostolos-bringing-the-good-word-of-proper-time-tracking-72564b354d72?source=rss-234e8b28ff9c------2</link>
            <guid isPermaLink="false">https://medium.com/p/72564b354d72</guid>
            <category><![CDATA[software]]></category>
            <category><![CDATA[freelance]]></category>
            <category><![CDATA[command-line-interface]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[time-tracking]]></category>
            <dc:creator><![CDATA[Stephan Meijer]]></dc:creator>
            <pubDate>Tue, 14 Dec 2021 23:00:00 GMT</pubDate>
            <atom:updated>2021-12-15T19:56:09.602Z</atom:updated>
            <content:encoded><![CDATA[<p>Time tracking has always been an issue for me as a freelance developer. Often we have to choose between key points as flexibility, compatibility, logical UI/UX or a good API. I am sure I’m not the only developer who came with the idea of integrating time tracking software with invoicing software.</p><p>Toggl has a UI that I don’t like. Zoho Books is flexible enough, but the API has not been updated to represent all the features available in the UI and the UI is sometimes hard to navigate through. Others are expensive and make me need to write APIs on my own if I want integrations. Time trackers are simple applications but often for me they either do too much or too little.</p><h3>So what are the alternatives?</h3><p>You could write a time tracking application in Google Spreadsheets using Google Apps Script. I’ve done that in the past. It gives great flexibility and with some effort, you can link it to anything you want. Any form of API, like creating a client for your bookkeeping software, can be done using Google Apps Script.</p><p>Only there are some issues. Validation of data is harder and the spreadsheet gets slow after filling your Spreadsheet with thousands of records. As a freelancer, I have 3 to 4 entries minimum per day. It’s doesn’t take long to take in how long you can use Google Spreadsheet for this without really thinking about performance.</p><h3>Introducing: the digital calendar</h3><p>For me, this issue has been solved by creating a small Symfony project using PHP8. This program uses the iCalendar-format to generate an overview of hours worked for a specific client or on a specific project.</p><h3>First, what is the iCalendar format?</h3><p>iCalendar is short for <em>Internet Calendaring and Scheduling Core Object Specification</em>. It sets a protocol for calendar clients to export and import events in a given digital calendar. This way, you can send someone a .ics file that other calendar applications understand and interpret. It looks a bit like this:</p><pre>BEGIN:VCALENDAR<br>VERSION:2.0<br>PRODID:-//hacksw/handcal//NONSGML v1.0//EN<br>BEGIN:VEVENT<br>UID:uid1@example.com<br>DTSTAMP:19970714T170000Z<br>ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com<br>DTSTART:19970714T170000Z<br>DTEND:19970715T040000Z<br>SUMMARY:Bastille Day Party<br>GEO:48.85299;2.36885<br>END:VEVENT<br>END:VCALENDAR</pre><p>At first, this might be a bit mystic. What is the data encoded in this format? Well, take a look if we do some indentation:</p><pre>BEGIN:VCALENDAR<br>    VERSION:2.0<br>    PRODID:-//hacksw/handcal//NONSGML v1.0//EN<br>    BEGIN:VEVENT<br>        UID:uid1@example.com<br>        DTSTAMP:19970714T170000Z<br>        ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com<br>        DTSTART:19970714T170000Z<br>        DTEND:19970715T040000Z<br>        SUMMARY:Bastille Day Party<br>        GEO:48.85299;2.36885<br>    END:VEVENT<br>END:VCALENDAR</pre><p>As you can see now more clearly, data such as location, time and day of start and end of the event, and small texts can be encoded in this format. This is very practical for events with a specific start time and end time. Do you see anything familiar already to the act of time tracking?</p><h3>So, how does it work?</h3><p>Calendar applications such as Google Calendars often have the ability to create new calendars. In this way, the user can keep their specific calendars isolated and separated. This is a very useful feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WDO1D7PAu0mcJB1p.png" /></figure><p>This allows us to create a calendar for a specific client or project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kI0kDtJw9_CRANgz.png" /></figure><p>Google Calendar has multiple ways to export this calendar to the iCalendar-format. First we have this <em>Export calendar</em> button. That downloads a zip with a .ics file.</p><p>That seems alright, but another more powerful feature is that iCalendar files can be submitted over the web. We can automatically retrieve a iCalendar file in our programs using the HTTP protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*clDjwoBCLwMC2ICQ.png" /></figure><p>The <em>Secret address in iCal format</em> stated in this form is an URL to the iCalendar file. Only the people with this very specific and very secret address can access this calendar.</p><h3>How would it integrate with Apostolos?</h3><p>Apostolos requires a configuration file in the Home-directory on the system of the user. In this document, the user can configure different calendars for different clients.</p><pre>calendars:<br>  - name: Client1<br>    url: &quot;https://calendar.google.com/calendar/ical/692cf04a-1d49-4772-b09b-0ec324853277/basic.ics&quot;<br>  - name : Client2<br>    url : &quot;https://calendar.google.com/calendar/ical/0f26df45-f42e-4e56-b495-67cb11f5ea91/basic.ics&quot;</pre><p>The url parameter in this example is the URL to the iCalendar file. Apostolos would retrieve the file from there, and give an overview of hours on a terminal:</p><pre>$ bin/console time:summary Client1 --year 2021 --month december</pre><p>The command would generate this overview:</p><pre>+--- Hours of 2021-12 ---+<br>| Day (start) | Duration |<br>+-------------+----------+<br>| 04-12-2021  | 03:53    |<br>| 07-12-2021  | 02:30    |<br>| 23-12-2021  | 10:00    |<br>+----- Total: 16:23 -----+</pre><p>Another output format is JSON. Using the --format parameter we could request the program to output JSON:</p><p>That would output a format like this:</p><pre>{<br>    &quot;meta&quot;: {<br>        &quot;calendar&quot;: &quot;Client1&quot;,<br>        &quot;year&quot;: 2021,<br>        &quot;month&quot;: 12,<br>        &quot;duration&quot;: {<br>            &quot;hours&quot;: 16,<br>            &quot;minutes&quot;: 23<br>        }<br>    },<br>    &quot;records&quot;: [<br>        {<br>            &quot;day&quot;: &quot;2021-12-04&quot;,<br>            &quot;duration&quot;: {<br>                &quot;hours&quot;: 3,<br>                &quot;minutes&quot;: 53<br>            }<br>        },<br>        {<br>            &quot;day&quot;: &quot;2021-12-23&quot;,<br>            &quot;duration&quot;: {<br>                &quot;hours&quot;: 10,<br>                &quot;minutes&quot;: 0<br>            }<br>        },<br>        {<br>            &quot;day&quot;: &quot;2021-12-07&quot;,<br>            &quot;duration&quot;: {<br>                &quot;hours&quot;: 2,<br>                &quot;minutes&quot;: 30<br>            }<br>        }<br>    ]<br>}</pre><h3>So why is this so flexible?</h3><p>You can use any calendar application for tracking time in iCalendar. That’s the beauty of this method. You don’t like a UI of a calendar application? Just use another! Almost like a free market of calendar applications. And the best thing: you don’t have to spend a dime on time tracking applications! Many calendar services are free of charge.</p><h3>Compatibility with other programs</h3><p>You can let programs interact with your timesheets without building any API clients yourself using this program. Do you want to automatically create an invoice based on the hours you have worked? You can do that! Do you want to create a PDF? You can do that!</p><p>One way I have used it is this:</p><pre>$ bin/console time:summary Client1 --year 2021 --month december --format json | php template.php | weasyprint - DecemberClient1.pdf</pre><p>This process creates a JSON, which inserts itself as input in a PHP-file. The PHP file generates some HTML for <a href="https://weasyprint.org/">WeasyPrint</a>, which creates a PDF.</p><p>You can create API bindings with your bookkeeping or accountant software if you have proper programming skills. Let’s call that program send_to_my_bookkeeping.py. You would be able to run it this way:</p><pre>$ bin/console time:summary Client1 --year 2021 --month december --format json | python3 send_to_my_bookkeeping.py</pre><p>You can use any program in any language to transform this data to the format you need. Such as invoice PDFs, overviews of hours worked for clients, emails, etc.</p><p>Now you have freedom of choice! Do you want to host your calendars using NextCloud and track time through them? You can! Do you want to use a proprietary product such as Google Calendar? You can! Using a URL that outputs data in the iCalendar format, you can use any calendar application of your choice.</p><p><em>Originally published at </em><a href="https://stephanmeijer.com/Apostolos/"><em>https://stephanmeijer.com</em></a><em> on December 15, 2021.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72564b354d72" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>