TaskFreak hacking part 2: date format

My TaskFreak hacking goes on. In Sweden we often use ISO 8601 format for dates (year-month-day), but TaskFreak does not offer this out of the box.

Most date formatting comes from the DATE FORMATS section in include/config.php but even after changing these date formats I still don’t get all dates displayed as I would like.

For example, the text box for the date when editing an item is using the TZN_DATE_FRM constant defined in include/classes/tzn_generic.php. There’s a pretty naïve comment in the source code, saying that there is a “US format” for dates and a “rest of the world” format. Fortunately (for the US), the rest of the world is not united in opposition.

To get the date format I wanted I changed the constant definition like this:

define("TZN_DATE_FRM","%Y-%m-%d");

TaskFreak hacking: changing first day of week to Monday

I have two personal TaskFreak installations now: one at work and a personal one for everything else.

Usually I run all my applications in English but the personal TaskFreak is in Swedish so the first thing I changed was a couple of things I didn’t agree with in the Swedish translation.

Then there was the issue with the calendar having Sunday as the first day of the week. For me, and probably 99.99% of all Swedes, it’s like wearing your trousers the wrong way round. Our weeks start on Mondays.

Assuming all users of the TaskFreak installation agree on this, it is very easy to fix:

  1. Open taskfreak/jscalendar/calendar-setup.php in your favorite text editor
  2. Find the line
    param_default("firstDay",0);
  3. Change 0 to 1
  4. Reload your TaskFreak web page

I hope to write a separate blog post about my coolest TaskFreak hack: a script that receives e-mails and creates a corresponding task in TaskFreak.