From bf4a58662871959a9e14d8915e5fc085fdcdc502 Mon Sep 17 00:00:00 2001 From: t1m0n Date: Mon, 5 Oct 2015 15:04:23 +0300 Subject: [PATCH] add page and day names style, modify day names render method --- css/style.css | 14 ++++++++++++ dist/css/datepicker.css | 17 ++++++++++++++ dist/js/datepicker.js | 12 +++++----- index.html | 8 ++++--- js/datepicker/body.js | 12 +++++----- sass/_page.scss | 19 ++++++++++++++++ sass/datepicker/_datepicker.scss | 31 ++++++++++++++++++++++++++ sass/datepicker/datepicker-config.scss | 3 +++ 8 files changed, 103 insertions(+), 13 deletions(-) create mode 100644 sass/datepicker/datepicker-config.scss diff --git a/css/style.css b/css/style.css index 64e46b8..d5723b0 100644 --- a/css/style.css +++ b/css/style.css @@ -54,3 +54,17 @@ a { textarea { overflow: auto; } + +/* ------------------------------------------------- + Page styles + ------------------------------------------------- */ +html { + font-family: Tahoma, sans-serif; + font-size: 13px; } + +.contents { + width: 960px; + margin: 0 auto; + padding: 1px 0; } + .contents article { + margin: 60px 0 30px; } diff --git a/dist/css/datepicker.css b/dist/css/datepicker.css index e69de29..600f749 100644 --- a/dist/css/datepicker.css +++ b/dist/css/datepicker.css @@ -0,0 +1,17 @@ +/* ------------------------------------------------- + Datepicker + ------------------------------------------------- */ +.datepicker { + border: 1px solid #dddddd; + width: 224px; } + +.datepicker--days--names { + display: flex; } + +.datepicker--days--name { + display: flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + text-align: center; } diff --git a/dist/js/datepicker.js b/dist/js/datepicker.js index 537b3d2..fcda346 100644 --- a/dist/js/datepicker.js +++ b/dist/js/datepicker.js @@ -140,15 +140,17 @@ Datepicker.Cell = function () { this.$cells = $('.datepicker--days--cells', this.$el); }, - _getDayNamesHtml: function (firstDay, curDay, html, circle) { + _getDayNamesHtml: function (firstDay, curDay, html, i) { curDay = curDay != undefined ? curDay : firstDay; html = html ? html : ''; - if (curDay == firstDay && circle) return html; - if (curDay == 7) return this._getDayNamesHtml(firstDay, 0, html, true); + i = i != undefined ? i : 0; - html += '
' + this.d.loc.days[curDay] + '
'; + if (i > 7) return html; + if (curDay == 7) return this._getDayNamesHtml(firstDay, 0, html, ++i); - return this._getDayNamesHtml(firstDay, ++curDay, html, circle); + html += '
' + this.d.loc.days[curDay] + '
'; + + return this._getDayNamesHtml(firstDay, ++curDay, html, ++i); }, _renderDays: function () { diff --git a/index.html b/index.html index fce917f..a06a865 100644 --- a/index.html +++ b/index.html @@ -8,9 +8,11 @@ -
- - +
+
+
+
+