MyTime Help

Exporting HTML templates

When you use the HTML format to export your work, the application asks you to specify a few things such as how you'd like the date to be displayed on your invoice (see following list), whether you'd like the invoice to have a number and how much tax there is to be added or whether a discount applies instead. (If you want to add a discount, just put in the percentage to be deducted with a minus in front of it.)

Conversion Specifier Description
%% a '%' character
%a abbreviated weekday name
%A full weekday name
%b abbreviated month name
%B full month name
%c shorthand for %X %x, the locale format for date and time
%d day of the month as a decimal number (01-31)
%e same as %d but does not print the leading 0 for days 1 through 9
%F milliseconds as a decimal number (000-999)
%H hour based on a 24-hour clock as a decimal number (00-23)
%I hour based on a 12-hour clock as a decimal number (01-12)
%j day of the year as a decimal number (001-366)
%m month as a decimal number (01-12)
%M minute as a decimal number (00-59)
%p AM/PM designation for the locale
%S second as a decimal number (00-59)
%w weekday as a decimal number (0-6), where Sunday is 0
%x date using the date representation for the locale
%X time using the time representation for the locale
%y year without century (00-99)
%Y year with century (such as 1990)
%Z time zone name (such as Pacific Daylight Time)
%z time zone offset in hours and minutes from GMT (HHMM)

Making Templates

You can create your own templates and use them with MyTime. Templates can be any ASCII file, even though the template export is geared more towards HTML export. You can use XML templates, .txt, .rtf, .php. To get straight down to business I am going to assume you're technically savvy. (If you create a nifty template and wish to share it with other users please email it to me at mytime@kakuweb.com and I'll include it in the application in the future.)

Building blocks of an HTML template

If you open any of the HTML templates that come with MyTime (you'll find them in the Templates folder in ~Library/Application Support/MyTime) you'll see that they are all set up very similar. By the way, a simple text editing program will work just fine for changing or even writing your own templates.
There is always a <head></head> and a <body></body> part. In the head part you put any structure for the template, be it CSS or HTML. In the body part you tell the template what it is you actually want it to display. The most important part of the body are the tags, such as the ones listed below. These tags represent the fields in MyTime and you can arrange them pretty much any which way you want. Just have a look at some of the MyTime templates to see what the different options are. To change a tag, simply replace one that's already present in the template with the one you want or copy paste one of the tags and then replace it for the one you want.

Fields you can have in a template

Template Fields are designed to be HTML comments. That way they won't be seen on a webpage when there is no data to fill them. They consist of the format "<!--Name-->". Keep in mind that when building templates, <!--BeginRepeatTask--> and <!--EndRepeatTask--> need to be placed inside the Begin and EndRepeatProjects tags. The rest of the fields are pretty self explanatory and are the following:

<!--Clienttitle--> <!--Clientnotes--> <!--Clientfirstname-->
<!--Clientlastname--> <!--Clientemail--> <!--Clientphone-->
<!--Clientstreetone--> <!--Clientorganization--> <!--Clientzip-->
<!--Clientstate--> <!--Clientcountry--> <!--Clientcity-->
<!--Clienttotaltime--> <!--Clientowed--> <!--Clienttax-->
<!--Clienttotaltax--> <!--Myinvoicenumber--> <!--Myfirstname-->
<!--Mylastname--> <!--Myorganization--> <!--Mytitle-->
<!--Myhomepage--> <!--Myemail--> <!--Myphone-->
<!--Mystreet--> <!--Mycity--> <!--Mystate-->
<!--Myzip--> <!--Mycountry--> <!--Myexportdate-->
<!--Mytax--> <!--Mytaxdiscount-->  
<!--BeginRepeatProject--> <!--Projecttitle--> <!--Projectdescription-->
<!--Projectnotes--> <!--Pojectcreated--> <!--Pojectfinished-->
<!--Pojectpaid--> <!--Pojectended--> <!--Pojecttotaltime-->
<!--Projecttotalowed--> <!--Projecttax--> <!--Projecttotaltax-->
<!--BeginRepeatTask--> <!--Taskname--> <!--Taskdescription-->
<!--Taskstartdate--> <!--Taskenddate--> <!--Tasktotaltime-->
<!--Taskfinished--> <!--Tasknotes--> <!--Taskrate-->
<!--Taskowed--> <!--Taskfile--> <!--Taskexpense-->
<!--Taskfixed--> <!--EndRepeatTask--> <!--EndRepeatProject-->
<!--Expenseheader--> <!--BeginRepeatExpense--> <!--EndRepeatExpense-->
<!--Expensefooter-->    

Special Tags

If you want to separate your expenses from your tasks inside a template, you have to put the following expense tags at the end of the template. <!--Expenseheader--> followed by <!--BeginRepeatExpense--> <!--EndRepeatExpense--> and <!--Expensefooter-->. Then you can add your expenses, which have the same tags as tasks, in between the Begin and EndRepeatExpense tags.

To make life easier for you, MyTime automatically fills in the <!--My...--> tags by using the personal entry from your address book. (The one that has a little black figure outline in front of it.) If you do not want MyTime to use that address or if you want to change the address for a specific invoice, you can go straight into the template folder, open the template in any text editor and replace the address.

How do I install my template?

Just place your .html file into the template folder located inside your MyTime folder. You should now see it on the pop menu in the export dialog box.

What do I do with images?

If your template includes images, place a folder with those images into the folder named "Images" in Templates and name the folder the same as your template, just with 'Images' at the end. For example template "hello.html" images would be in a folder named "helloImages" inside Images folder in templates. And all images must be referenced in the html as images/imageName. If using a Web Designer, it's best to use a folder named "Images" in the same root as your html and then rename it on installation.

For a more detailed understanding, browse the already installed templates and try to mimic those.

Have fun!