Sha256: 55e2e413755531af5cf74b7127dc7b38356b1c5d0169f3664f62e0a20a4ba261

Contents?: true

Size: 945 Bytes

Versions: 10

Compression:

Stored size: 945 Bytes

Contents

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());
}

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
dojo_src-1.5.0 dojo/dojox/dtl/tag/date.js
dojo_src-1.4.3 dojo/dojox/dtl/tag/date.js
dojo_src-1.4.102 dojo/dojox/dtl/tag/date.js
dojo-pkg-1.132.0 data/dojo-release-1.3.2-src/dojox/dtl/tag/date.js
dojo-pkg-1.120.0 data/dojo-release-1.2.0-src/dojox/dtl/tag/date.js
dojo-pkg-1.121.0 data/dojo-release-1.2.1-src/dojox/dtl/tag/date.js
dojo-pkg-1.122.0 data/dojo-release-1.2.2-src/dojox/dtl/tag/date.js
dojo-pkg-1.123.0 data/dojo-release-1.2.3-src/dojox/dtl/tag/date.js
dojo-pkg-1.130.0 data/dojo-release-1.3.0-src/dojox/dtl/tag/date.js
dojo-pkg-1.131.0 data/dojo-release-1.3.1-src/dojox/dtl/tag/date.js