Skip to content

Instantly share code, notes, and snippets.

@Mikke
Created March 27, 2012 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mikke/2215048 to your computer and use it in GitHub Desktop.
Save Mikke/2215048 to your computer and use it in GitHub Desktop.
calendarFail
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
@import "/custom/dojo/resources/dojo.css";
@import "/custom/dijit/themes/tundra/tundra.css";
@import "/custom/dijit/themes/dijit.css";
@import "/custom/dojox/widget/Calendar/Calendar.css";
.title {
font-weight: bolder;
}
</style>
<title>Calendar page</title>
<link href="/myfirstdojowidget/style.css" media="screen" rel="stylesheet" type="text/css" />
<!-- Configure Dojo -->
<script>
// We're specifying our Dojo Configuration this way,
// as it's a bit more complex and easier to type out
// than a data-dojo-config string
var dojoConfig = (function(){
var base = location.href.split("/");
base.pop();
base = base.join("/");
return {
async: false,
isDebug: true,
packages: [{
name: "custom",
location: base + "/custom"
}]
};
})();
</script>
<!-- Load up Dojo -->
<script src="/custom/dojo/dojo.js"></script>
<script src="/custom/dijit/dijit.js"></script>
<script>
dojo.require("dijit.dijit"); // loads the optimized dijit layer
dojo.require("dijit.Calendar");
</script>
</head>
<body>
<h1>Calendar Example</h1>
<div data-dojo-type="dijit.Calendar" data-dojo-props="onChange:function(){dojo.byId('formatted').innerHTML=dojo.date.locale.format(arguments[0], {formatLength: 'full', selector:'date'})}"></div>
<p id="formatted"></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment