dojox/dtl/tag/date.js

  • Provides:

    • dojox.dtl.tag.date
  • Requires:

    • dojox.dtl._base in common
    • dojox.dtl.utils.date in common
  • dojox.dtl.tag.date.NowNode

    • type
      Function
    • parameters:
      • format: (typeof )
      • node: (typeof )
    • source: [view]
       this._format = format;
       this.format = new dojox.dtl.utils.date.DateFormat(format);
       this.contents = node;
    • summary
  • dojox.dtl.tag.date.NowNode._format

    • summary
  • dojox.dtl.tag.date.NowNode.format

    • summary
  • dojox.dtl.tag.date.NowNode.contents

    • summary
  • dojox.dtl.tag.date.now

    • type
      Function
    • parameters:
      • parser: (typeof )
      • token: (typeof )
    • source: [view]
      dojo.provide("dojox.dtl.tag.date");


      dojo.require("dojox.dtl._base");
      dojo.require("dojox.dtl.utils.date");


      dojox.dtl.tag.date.NowNode = function(format, node){
       this._format = format;
       this.format = new dojox.dtl.utils.date.DateFormat(format);
       this.contents = node;
      }
      dojo.extend(dojox.dtl.tag.date.NowNode, {
       render: function(context, buffer){
        this.contents.set(this.format.format(new Date()));
        return this.contents.render(context, buffer);
       },
       unrender: function(context, buffer){
        return this.contents.unrender(context, buffer);
       },
       clone: function(buffer){
        return new this.constructor(this._format, this.contents.clone(buffer));
       }
      });


      dojox.dtl.tag.date.now = function(parser, token){
       // Split by either :" or :'
       var parts = token.split_contents();
       if(parts.length != 2){
        throw new Error("'now' statement takes one argument");
       }
       return new dojox.dtl.tag.date.NowNode(parts[1].slice(1, -1), parser.create_text_node());
    • summary
  • dojox.dtl.tag.date.NowNode.render

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
        this.contents.set(this.format.format(new Date()));
        return this.contents.render(context, buffer);
    • summary
  • dojox.dtl.tag.date.NowNode.unrender

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
        return this.contents.unrender(context, buffer);
    • summary
  • dojox.dtl.tag.date.NowNode.clone

    • type
      Function
    • parameters:
      • buffer: (typeof )
    • source: [view]
        return new this.constructor(this._format, this.contents.clone(buffer));
    • summary
  • dojox.dtl.tag.date

    • type
      Object
    • summary
  • dojox.dtl.tag

    • type
      Object
    • summary
  • dojox.dtl

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary