C
Chris
Hi,
I'm kind of new to the more involved workings of javascript, and am
having a few problems.
My problem is this: I am working with a CMS which is including various
javascrip files in the pages, including files for a calendar
(Dynarch).
I would like to add some new functionality to the CMS and add some
extra javascript files from a different calendar (Zapatech). The
Zapatech calendar is veeeeeeery closely based on the Dynarch calendar.
Both calendars extend the Date object, and in many places use the same
prototype function names e.g. Date.prototype.getMonthDays
The problem is that calling Date.getMonthDays, for example, calls the
definition from the Dynarch files (these files are included in the
page first), whereas I want it to call the definition in the Zapatech
files.
I have been looking for a way to apply appropriate namespacing, via
inheriting the Date class into a new class e.g. ZDate, but have not
figured out how to successfully achieve this.
For example, my attempts at the new ZDate class will return an error
when you try ZDate.parse("Jul 8, 2008"); stating that ZDate.parse is
not a function
So my question is how do I succesfully seperate my new javascript from
the already present definitions.
(or alternatively, is there a way to remove all the additions made to
the Date class, and start with a fresh Date version for my new
javascript?)
Any help in this is greatly appreciated!
Chris
I'm kind of new to the more involved workings of javascript, and am
having a few problems.
My problem is this: I am working with a CMS which is including various
javascrip files in the pages, including files for a calendar
(Dynarch).
I would like to add some new functionality to the CMS and add some
extra javascript files from a different calendar (Zapatech). The
Zapatech calendar is veeeeeeery closely based on the Dynarch calendar.
Both calendars extend the Date object, and in many places use the same
prototype function names e.g. Date.prototype.getMonthDays
The problem is that calling Date.getMonthDays, for example, calls the
definition from the Dynarch files (these files are included in the
page first), whereas I want it to call the definition in the Zapatech
files.
I have been looking for a way to apply appropriate namespacing, via
inheriting the Date class into a new class e.g. ZDate, but have not
figured out how to successfully achieve this.
For example, my attempts at the new ZDate class will return an error
when you try ZDate.parse("Jul 8, 2008"); stating that ZDate.parse is
not a function
So my question is how do I succesfully seperate my new javascript from
the already present definitions.
(or alternatively, is there a way to remove all the additions made to
the Date class, and start with a fresh Date version for my new
javascript?)
Any help in this is greatly appreciated!
Chris