Other Functions Used By Epoch PrimeIn addition to the core code that makes up Epoch Prime, several other functions have been added to improve on existing DOM functionality, as well as account for different implementations between browsers. These functions can be used anywhere on your page; not just in Epoch Prime, as long as epochprime_classes.js is sourced to your page. JavaScript Date Object AdditionsTo provide extra functionality to the JavaScript Date object and reduce overall code complexity, several functions have been added to the standard functions available. You can access these functions in the same manner as the standard Date methods, i.e. var prettydate = mydate.dateFormat('Y-m-d'); Date::getDayOfYear()Returns the day of the year (0 to 365/366) for this date. Arguments(none)Return ValuesintDate::getWeek()Returns the week number for this date. dowOffset is the day of week the week "starts" on for your locale - it can be from 0 to 6. If dowOffset is 1 (Monday), the week returned is the ISO week number. Arguments
Return ValuesintDate::getUeDay()Returns the number of DAYS since the UNIX Epoch – good for comparing the date portion without taking into account the time. Arguments(none)Return ValuesintDate::dateFormat(format)Formats the date in the format specified in format. If format is NOT set, it will default to the ISO 8601 date/time standard (i.e. 2006-04-05 20:52:21), or to a format set by the user. The format string components are the same as the PHP date() function, with minor exceptions. Arguments
Return ValuesstringUsageThe format string consists of the following abbreviations: Days
Months
Years
Times
DOM-related functionsSome of these functions exist to mediate the differences of DOM implementation between different browsers, while others are added to make certain DOM-related operations easier and faster. addEventHandler(element, type, func)Dynamically adds an event handler function to an element – use this function instead of direct event handler assignment (i.e. obj.onclick=xxx)when possible, since it allows you to have multiple event handlers for the same element. This function is a workaround to deal with Internet Explorer's nonstandard DOM event model. Arguments
Return Values(none)Usagetype can be any one of the standard DOM events (click, mousedown, submit, focus, etc). removeEventHandler(element, type, func)Dynamically adds an event handler function to an element – use this function instead of direct event handler assignment when possible, since it allows you to have multiple event handlers for the same element. This function is a workaround to deal with Internet Explorer's poorly-implemented DOM event model. Arguments
Return Values(none)Usagetype can be any one of the standard DOM events (click, mousedown, submit, focus, etc). function getTop(element)Returns the absolute Top value of element, in pixels Arguments
Return Valuesintfunction getLeft(element)Returns the absolute Left value of element, in pixels Arguments
Return Valuesint |