Location: A review of cardiac cellular electrophysiology models @ a80b964384c0 / dojo-presentation / js / dojo / dojox / dtl / tag / date.js

Author:
David Nickerson <nickerso@users.sourceforge.net>
Date:
2010-05-04 12:37:19+12:00
Desc:
adding initial version of SED-ML L1V1 file reproducing what is in graphs/BR-INa-variants.xml
Permanent Source URI:
https://models.cellml.org/workspace/a1/rawfile/a80b964384c0c7683d7c5d07b73a5af7a973d46c/dojo-presentation/js/dojo/dojox/dtl/tag/date.js

dojo.provide("dojox.dtl.tag.date");

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

dojox.dtl.tag.date.NowNode = function(format, TextNode){
	this.format = new dojox.dtl.utils.date.DateFormat(format);
	this.contents = new TextNode("");
}
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);
	}
});

dojox.dtl.tag.date.now = function(parser, text){
	// Split by either :" or :'
	var parts = text.split((text.substring(0, 5) == "now '") ? "'" : '"');
	if(parts.length != 3){
		throw new Error("'now' statement takes one argument");
	}
	var format = parts[1];
	return new dojox.dtl.tag.date.NowNode(format, parser.getTextNodeConstructor());
}