To use the calendar compondent add to the head of your file :
+
+<script src="/bower_components/platform/platform.js"></script>
+<link rel="import" href="calendar.htm">
+
+ To display a calendar just type in your html code :
+<zdk-calendar id="cal1"></zdk-calendar>
+ To get the clicked date :
+
+document.querySelector("#cal1").addEventListener('select', function(e) {
+ document.querySelector("#cal1Date").innerHTML = e.detail.day;
+}, false);
+
+ The change event send an object containing a human readeable date and a timestamp to use in your script
+ + +You could choose your own language settings for exemple : "en-US"
+<zdk-calendar i18n="en-US"></zdk-calendar>
+ The calendar will adapt to the setting of the selected language and also the format of the date of the event "change". + Change the property "i18n" programmatically will automatically update the component.
+By default, the component takes the language settings of the browser.
+Changing the date of a calendar is very easy.
+in HTML, simply add a date property :
+<zdk-calendar id="cal3" date="2014-02-10"></zdk-calendar>
+ programaticaly, set the date property of the object :
+
+var cal3 = document.getElemementById("cal3");
+cal3.date = "2014-02-10";
+
+ The date property could be a miliseconds timestamp ( new Date().getTime() ), a string formated as "YYYY-MM-DD" or + a localy date string for example in france ( "10/02/2010" ), or a js Date object.
+You can easily combine two or more calendars, by listening to the "dateChange" event send when clicking the previous/next month or today button. + This event send the new reference timestamp in milliseconds
+the code :
+
+document.querySelector("#cal4").addEventListener('dateChange', function(e) {
+ var date = new Date(e.detail);
+ date.setMonth(date.getMonth()+1);
+ document.querySelector("#cal5").setAttribute("date", date);
+}, false);
+document.querySelector("#cal5").addEventListener('dateChange', function(e) {
+ var date = new Date(e.detail);
+ date.setMonth(date.getMonth()-1);
+ document.querySelector("#cal4").setAttribute("date", date);
+}, false);
+
+
+
\ No newline at end of file
diff --git a/left.png b/left.png
new file mode 100644
index 0000000..ae7ad5f
Binary files /dev/null and b/left.png differ
diff --git a/point.png b/point.png
new file mode 100644
index 0000000..f68e202
Binary files /dev/null and b/point.png differ
diff --git a/right.png b/right.png
new file mode 100644
index 0000000..5e7e0df
Binary files /dev/null and b/right.png differ
diff --git a/zdk-calendar.css b/zdk-calendar.css
new file mode 100644
index 0000000..4b0ee80
--- /dev/null
+++ b/zdk-calendar.css
@@ -0,0 +1,39 @@
+:host {
+ display: inline-block;
+ width:300px;
+ height:300px;
+ font-family:Verdana, Helvetica;
+ font-size:14px;
+}
+* { box-sizing: border-box;}
+div#calendar {
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+}
+div#calendar div {
+ flex:1;
+ border-collapse:collapse;
+ display:flex;
+}
+div.head img {
+ width:100%;
+}
+div.row div {
+ justify-content: center;
+ align-items: center;
+ text-align: center;
+}
+div.day:hover {
+ background:#ccc;
+}
+div.today {
+ font-weight:bold;
+ color:tomato;
+}
+div.d1 {
+ background: antiquewhite;
+}
+div.head: {
+ background: var(head-bg);
+}
\ No newline at end of file
diff --git a/zdk-calendar.htm b/zdk-calendar.htm
new file mode 100644
index 0000000..b2c50bc
--- /dev/null
+++ b/zdk-calendar.htm
@@ -0,0 +1,121 @@
+
+
+
+