dojox/dtl/utils/date.js

  • Provides:

    • dojox.dtl.utils.date
  • Requires:

    • dojox.date.php in common
  • dojox.dtl.utils.date.DateFormat

    • type
      Function
    • parameters:
      • format: (typeof String)
    • source: [view]
       dojox.date.php.DateFormat.call(this, format);
    • chains:
      • dojox.date.php.DateFormat: (call)
    • mixins:
      • dojox.date.php.DateFormat.prototype: (prototype)
    • summary
  • dojox.dtl.utils.date.DateFormat.f

    • type
      Function
    • source: [view]
        return (!this.date.getMinutes()) ? this.g() : this.g() + ":" + this.i();
    • summary
      Time, in 12-hour hours and minutes, with minutes left off if they're zero.
    • description
      Examples: '1', '1:30', '2:05', '2'
      Proprietary extension.
  • dojox.dtl.utils.date.DateFormat.N

    • type
      Function
    • source: [view]
        return dojox.dtl.utils.date._months_ap[this.date.getMonth()];
    • summary
      Month abbreviation in Associated Press style. Proprietary extension.
  • dojox.dtl.utils.date.DateFormat.P

    • type
      Function
    • source: [view]
        if(!this.date.getMinutes() && !this.date.getHours()){
         return 'midnight';
        }
        if(!this.date.getMinutes() && this.date.getHours() == 12){
         return 'noon';
        }
        return this.f() + " " + this.a();
    • summary
      Time, in 12-hour hours, minutes and 'a.m.'/'p.m.', with minutes left off
      if they're zero and the strings 'midnight' and 'noon' if appropriate.
    • description
      Examples: '1 a.m.', '1:30 p.m.', 'midnight', 'noon', '12:30 p.m.'
      Proprietary extension.
  • dojox.dtl.utils.date.format

    • type
      Function
    • parameters:
      • date: (typeof Date)
      • format: (typeof String)
    • source: [view]
        var df = new dojox.dtl.utils.date.DateFormat(format);
        return df.format(date);
    • summary
  • dojox.dtl.utils.date.timesince

    • type
      Function
    • parameters:
      • d: (typeof )
      • now: (typeof )
    • source: [view]
        if(!(d instanceof Date)){
         d = new Date(d.year, d.month, d.day);
        }
        if(!now){
         now = new Date();
        }


        var delta = Math.abs(now.getTime() - d.getTime());
        for(var i = 0, chunk; chunk = dojox.dtl.utils.date._chunks[i]; i++){
         var count = Math.floor(delta / chunk[0]);
         if(count) break;
        }
        return count + " " + chunk[1](count);
    • summary
      Takes two datetime objects and returns the time between then and now
      as a nicely formatted string, e.g "10 minutes"
    • description
      Adapted from http://blog.natbat.co.uk/archive/2003/Jun/14/time_since
  • dojox.dtl.utils.date._chunks

    • summary
  • dojox.dtl.utils.date._months_ap

    • summary
  • dojox.dtl.utils.date

    • type
      Object
    • summary
  • dojox.dtl.utils

    • type
      Object
    • summary
  • dojox.dtl

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary