Bw.Widgets.DateLabel = 
{
	superclassName: "Bw.Widgets.Label",
	selfclassName: "Bw.Widgets.DateLabel",
	
	create: function (val, input, output)
	{
		var obj = document.createElement ("div");
		
		obj.setAttribute ("value", val);
		obj.setAttribute ("input", input);
		obj.setAttribute ("output", output);
		
		Bw.Core.bootstrap (obj, "Bw.Widgets.DateLabel");
		
		return obj;
	},

	initialize: function ()
	{
		this.input = Bw.Date.Format.create (this.getAttribute ("input"));
		this.output = Bw.Date.Format.create (this.getAttribute ("output"));
		
		Bw.Widgets.Label.initialize.call (this);
	},
	
	setValue: function (val)
	{
		var d = Bw.Date.Helpers.read (val, this.input);
		val = Bw.Date.Helpers.write (d, this.output);
		
		Bw.Widgets.Label.setValue.call (this, val);
	}
};


