i haven't had much luck finding what i'm looking for, so maybe i'm not
looking for it correctly.

i want to add several properties (booleans indicating special dates)
to the native Date object that are assigned when the date is
instantiated. However, i'm not sure how i can do that.

i know i can extend Date with methods that return a boolean:
Object.extend(Date,{
  isEaster:function(){return ...},
  isLaborDay:function(){return ...},
  etc.
});

but as far as i know, they have to be called after the Date is
created. i'm trying to simulate native properties, eg:
Date = Class.create(Date, {
  initialize:function(){
    $super(arguments[0], ...);
    this.isEaster = this._isEaster();
    this.isLaborDay = this.isEaster ? false : this._isLaborDay();
    // etc...
  },
  _isEaster:function(){ return ... },
  _isLaborDay:function(){ return ... }
});

i'm AWARE the above Class call doesn't work. But something like that
is what i'm trying to achieve. How can i modify the native object's
constructor to do its normal call, and also assign these properties?

Any help?
-joe t.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to