diff --git a/install.sh b/install.sh index f433a6e91e..7d179ec8b3 100755 --- a/install.sh +++ b/install.sh @@ -353,7 +353,6 @@ SUNSTONE_DIRS="$SUNSTONE_LOCATION/routes \ $SUNSTONE_LOCATION/public/vendor/4.0/nouislider \ $SUNSTONE_LOCATION/public/vendor/4.0/jdpicker_1.1 \ $SUNSTONE_LOCATION/public/vendor/4.0/jdpicker_1.1/images \ - $SUNSTONE_LOCATION/public/vendor/4.0/datetimepicker \ $SUNSTONE_LOCATION/public/images \ $SUNSTONE_LOCATION/views" @@ -570,7 +569,6 @@ INSTALL_SUNSTONE_FILES=( SUNSTONE_PUBLIC_NEW_VENDOR_JDPICKER:$SUNSTONE_LOCATION/public/vendor/4.0/jdpicker_1.1 SUNSTONE_PUBLIC_NEW_VENDOR_JDPICKER_IMAGES:$SUNSTONE_LOCATION/public/vendor/4.0/jdpicker_1.1/images SUNSTONE_PUBLIC_NEW_VENDOR_TIMEPICKER:$SUNSTONE_LOCATION/public/vendor/4.0/ - SUNSTONE_PUBLIC_NEW_VENDOR_DATETIMEPICKER:$SUNSTONE_LOCATION/public/vendor/4.0/datetimepicker SUNSTONE_PUBLIC_IMAGES_FILES:$SUNSTONE_LOCATION/public/images SUNSTONE_PUBLIC_LOCALE_CA:$SUNSTONE_LOCATION/public/locale/ca SUNSTONE_PUBLIC_LOCALE_CS_CZ:$SUNSTONE_LOCATION/public/locale/cs_CZ @@ -1683,16 +1681,6 @@ SUNSTONE_PUBLIC_NEW_VENDOR_JDPICKER_IMAGES="\ SUNSTONE_PUBLIC_NEW_VENDOR_TIMEPICKER="src/sunstone/public/vendor/4.0/jquery.timePicker.min.js" -SUNSTONE_PUBLIC_NEW_VENDOR_DATETIMEPICKER="\ - src/sunstone/public/vendor/4.0/datetimepicker/LICENSE.txt \ - src/sunstone/public/vendor/4.0/datetimepicker/README.md \ - src/sunstone/public/vendor/4.0/datetimepicker/design/dtpicker_mock.png \ - src/sunstone/public/vendor/4.0/datetimepicker/design/dtpicker_mock.svg \ - src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.css \ - src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.html \ - src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.js \ - src/sunstone/public/vendor/4.0/datetimepicker/simple-dtpicker.jquery.json" - SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \ src/sunstone/public/images/favicon.ico \ src/sunstone/public/images/login_over.png \ diff --git a/src/sunstone/public/vendor/4.0/datetimepicker/CHANGES b/src/sunstone/public/vendor/4.0/datetimepicker/CHANGES deleted file mode 100644 index ba9a39f552..0000000000 --- a/src/sunstone/public/vendor/4.0/datetimepicker/CHANGES +++ /dev/null @@ -1,17 +0,0 @@ -Version history for query-simple-datetimepicker -https://github.com/mugifly/jquery-simple-datetimepicker/ - -1.1.1 2013-03-12 - - [Fixed] Fixed width of timelist for bug in ie9 (Thanks to: jjsgro). - -1.1.0 2013-03-02 - - [Implement] Option to disable the animation. - - [Improve] Animation and parts. - - [Fixed] Support dateFormat and fix bug (Thanks to: LeandroSe). - - [Fixed] Support Firefox in current date (Thanks: LeandroSe). - - [Improve] Show the month name instead of number in header (Thanks to: dsims). - - [Fixed] appendDtpicker is not overriding the default date with the input's value (Thanks: dsims). - - [Fixed] default month (Thanks: dsims). - -1.0.0 2012-11-02 - - Initial release. diff --git a/src/sunstone/public/vendor/4.0/datetimepicker/LICENSE.txt b/src/sunstone/public/vendor/4.0/datetimepicker/LICENSE.txt deleted file mode 100644 index fbf0f4fac4..0000000000 --- a/src/sunstone/public/vendor/4.0/datetimepicker/LICENSE.txt +++ /dev/null @@ -1,8 +0,0 @@ -Copyright (c) 2013 Masanori Ohgita (http://ohgita.info/). - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/src/sunstone/public/vendor/4.0/datetimepicker/README.md b/src/sunstone/public/vendor/4.0/datetimepicker/README.md deleted file mode 100644 index ee04b42b38..0000000000 --- a/src/sunstone/public/vendor/4.0/datetimepicker/README.md +++ /dev/null @@ -1,30 +0,0 @@ -jquery-simple-datetimepicker (jquery.simple-dtpicker.js) -======== - -Date and time picker, simply. (jquery plugin) - -![screenshot](https://raw.github.com/mugifly/jquery-simple-datetimepicker/master/design/dtpicker_mock.png) - -Details and samples: http://mugifly.github.com/jquery-simple-datetimepicker - -Your feedback is highly appreciated. -you can send requests and bug reports as [Issues on GitHub](https://github.com/mugifly/jquery-simple-datetimepicker/issues). - -## Requirements - -* jQuery 1.7.2 or later - -## Contributors -Thank you to: - -* [LeandroSe](https://github.com/LeandroSe/) -* [dsims](https://github.com/dsims/) -* [jjsgro](https://github.com/jjsgro) - -## License and author - -Copyright (c) 2013 Masanori Ohgita (http://ohgita.info/). - -This program is free software distributed under the terms of the MIT license. -See LICENSE.txt for details. - diff --git a/src/sunstone/public/vendor/4.0/datetimepicker/design/dtpicker_mock.png b/src/sunstone/public/vendor/4.0/datetimepicker/design/dtpicker_mock.png deleted file mode 100644 index 8a47e1d48f..0000000000 Binary files a/src/sunstone/public/vendor/4.0/datetimepicker/design/dtpicker_mock.png and /dev/null differ diff --git a/src/sunstone/public/vendor/4.0/datetimepicker/design/dtpicker_mock.svg b/src/sunstone/public/vendor/4.0/datetimepicker/design/dtpicker_mock.svg deleted file mode 100644 index 0ea5ea6b21..0000000000 --- a/src/sunstone/public/vendor/4.0/datetimepicker/design/dtpicker_mock.svg +++ /dev/null @@ -1,930 +0,0 @@ - - - - - dtpicker - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - dtpicker - - - Masanori Ohgita - - - 2012/11/01 - - - Masanori Ohgita - - - - - Masanori Ohgita - - - - https://github.com/mugifly/jquery-simple-datetimepicker/ - https://github.com/mugifly/jquery-simple-datetimepicker/ - ja-JP - - - - - - - - - - - 2012/10/24 09:30 - - - - - - - - - - - - - - - - - - 30 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 1 - 2 - 3 - - - 2012/10 - < - < - - - - - 12:00 - - - 09:00 - 09:30 - 10:00 - 10:30 - 11:00 - 11:30 - - diff --git a/src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.css b/src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.css deleted file mode 100644 index 906df4289d..0000000000 --- a/src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.css +++ /dev/null @@ -1,269 +0,0 @@ -/** - * Style-sheet for dtpicker - * https://github.com/mugifly/jquery-simple-datetimepicker - */ - -.datepicker { - display: inline-block; - - border: 2px solid #c8c8c8; - - border-radius: 5px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - box-shadow: 0.5px 0.5px 3px #c8c8c8; - -webkit-box-shadow: 0.5px 0.5px 3px #c8c8c8; - -moz-box-shadow: 0.5px 0.5px 3px #c8c8c8; -} - -/* - * datepicker_header -*/ - -.datepicker > .datepicker_header{ - padding-top: 2px; - padding-bottom: 2px; - padding-left: 5px; - padding-right: 5px; - background-color: #d2d2d2; - color: #3f3f3f; - text-align: center; - font-size: 9pt; - font-weight: bold; -} - -.datepicker > .datepicker_header > a{ - user-select: none; - -webkit-user-select: none; - -moz-user-select: none; - cursor: pointer; - color: #559abd; -} - -.datepicker > .datepicker_header > a:hover { - color: #000000; - background-color: #c8c8c8; -} - -.datepicker > .datepicker_header > a:active { - color: #ffffff; - background-color: #808080; -} - -.datepicker > .datepicker_header > span { - margin-left: 20px; - margin-right: 20px; - user-select: none; - -webkit-user-select: none; - -moz-user-select: none; -} - -/* - * datepicker_inner_container -*/ - -.datepicker > .datepicker_inner_container { - margin: -2px -2px -2px -2px; - background-color: #d2d2d2; - border: 2px solid #c8c8c8; - border-radius: 5px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - - box-shadow: 0.5px 0px 5px #c8c8c8; - -webkit-box-shadow: 0.5px 0px 5px #c8c8c8; - -moz-box-shadow: 0.5px 0px 5px #c8c8c8; -} - -.datepicker > .datepicker_inner_container:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - -/* - * datepicker_inner_container > datepicker_calendar -*/ - -.datepicker > .datepicker_inner_container > .datepicker_calendar { - float: left; - width: auto; - - margin-top: -0.5px; - margin-left: -1px; - margin-bottom: -2px; - - background-color: #ffffff; - border: 1px solid #c8c8c8; - - border-top:none; - border-top-left-radius: 5px; - border-bottom-left-radius: 5px; - -webkit-border-top-left-radius: 5px; - -webkit-border-bottom-left-radius: 5px; - -moz-border-radius-topleft: 5px; - -moz-border-radius-bottomleft: 5px; -} - -.datepicker > .datepicker_inner_container > .datepicker_calendar > table { - padding: 10px; -} - -/* - * datepicker_inner_container > datepicker_calendar > datepicker_table > tbody > tr > th (WDay-cell) -*/ - -.datepicker > .datepicker_inner_container > .datepicker_calendar > .datepicker_table > tbody > tr > th { - color: #646464; - width: 18px; - font-size: small; - font-weight: normal; - text-align:center; -} - -/* - * datepicker_inner_container > datepicker_calendar > datepicker_table > tbody > tr > td (Day-cell) -*/ - -.datepicker > .datepicker_inner_container > .datepicker_calendar > .datepicker_table > tbody > tr > td { - color: #000000; - font-size: small; - text-align:center; - - user-select: none; - -webkit-user-select: none; - -moz-user-select: none; - cursor: pointer; -} - -.datepicker > .datepicker_inner_container > .datepicker_calendar > .datepicker_table > tbody > tr > td.today { - border-bottom: #bfbfbf solid 2px; - margin-bottom: -2px; -} - -.datepicker > .datepicker_inner_container > .datepicker_calendar > .datepicker_table > tbody > tr > td.wday_sat { - color: #0044aa; -} - -.datepicker > .datepicker_inner_container > .datepicker_calendar > .datepicker_table > tbody > tr > td.wday_sun { - color: #e13b00; -} - -.datepicker > .datepicker_inner_container > .datepicker_calendar > .datepicker_table > tbody > tr > td.day_another_month { - color: #cccccc; -} - -.datepicker > .datepicker_inner_container > .datepicker_calendar > .datepicker_table > tbody > tr > td.active { - color: #ffffff; - background-color: #808080; -} - -.datepicker > .datepicker_inner_container > .datepicker_calendar > .datepicker_table > tbody > tr > td.hover { - color: #000000; - background-color: #c8c8c8; -} - -/* - * datepicker_inner_container > datepicker_timelist -*/ - -.datepicker > .datepicker_inner_container > .datepicker_timelist { - float: left; - width: 4.2em; - height: 118px; - - margin-top: -0.5px; - padding: 5px; - padding-left: 0px; - padding-right: 0px; - - overflow: auto; - overflow-x: hidden; - - background-color: #ffffff; - - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - -webkit-border-top-right-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-bottomright: 4px; -} - -/* -.datepicker > .datepicker_inner_container > .datepicker_timelist::after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} -*/ - -.datepicker > .datepicker_inner_container > .datepicker_timelist::-webkit-scrollbar { - overflow: hidden; - width: 6px; - background: #fafafa; - - border-top-right-radius: 5px; - border-bottom-right-radius: 5px; - -webkit-border-top-right-radius: 5px; - -webkit-border-bottom-right-radius: 5px; - -moz-border-radius-topright: 5px; - -moz-border-radius-bottomright: 5px; -} - -.datepicker > .datepicker_inner_container > .datepicker_timelist::-webkit-scrollbar:horizontal { - height: 1px; -} - -.datepicker > .datepicker_inner_container > .datepicker_timelist::-webkit-scrollbar-button { - display: none; -} - -.datepicker > .datepicker_inner_container > .datepicker_timelist::-webkit-scrollbar-piece { - background: #eee; -} - -.datepicker > .datepicker_inner_container > .datepicker_timelist::-webkit-scrollbar-piece:start { - background: #eee; -} - -.datepicker > .datepicker_inner_container > .datepicker_timelist::-webkit-scrollbar-thumb { - background: #aaaaaa; - border-radius: 3px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; -} - -.datepicker > .datepicker_inner_container > .datepicker_timelist::-webkit-scrollbar-corner { - background: #333; -} - -.datepicker > .datepicker_inner_container > .datepicker_timelist > div.timelist_item { - padding-top: 1px; - padding-bottom:1px; - padding-left: 7px; - padding-right: 25px; - margin-top: 5px; - margin-bottom: 2px; - font-size: small; - - user-select: none; - -webkit-user-select: none; - -moz-user-select: none; - cursor: pointer; -} - -.datepicker > .datepicker_inner_container > .datepicker_timelist > div.timelist_item.active { - color: #ffffff; - background-color: #808080; -} - -.datepicker > .datepicker_inner_container > .datepicker_timelist > div.timelist_item.hover { - color: #000000; - background-color: #c8c8c8; -} - diff --git a/src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.html b/src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.html deleted file mode 100644 index 9d7d7df908..0000000000 --- a/src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - Demo - jquery-simple-datetimepicker - - - - - - - - - - - -
-

Demo - jquery-simple-datetimepicker

-
- -

Inline

-
- - -

Append to Input-field

- - - -

Append to Input-field (Inline)

- - - In addition, this default date has specified by the input's value ("2012-01-01 10:00"). - -

Set options

- About details for these options, please see: Wiki. - -
Current date ("current": "2012-3-4 12:30")
- - - -
dateFormat ("dateFormat": "YY/MM/DD h:m")
- - - - -
locale ("locale": "ja")
- - - -
Disable the fade animation ("animation": false)
- - - - - - \ No newline at end of file diff --git a/src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.js b/src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.js deleted file mode 100644 index cee249d038..0000000000 --- a/src/sunstone/public/vendor/4.0/datetimepicker/jquery.simple-dtpicker.js +++ /dev/null @@ -1,574 +0,0 @@ -/** - * dtpicker (jquery-simple-datetimepicker) - * (c) Masanori Ohgita - 2013. - * https://github.com/mugifly/jquery-simple-datetimepicker - */ - - (function($) { - var DAYS_OF_WEEK_EN = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']; - var DAYS_OF_WEEK_JA = ['日', '月', '火', '水', '木', '金', '土']; - var MONTHS_EN = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; - - var PickerObjects = []; - var InputObjects = []; - var ActivePickerId = -1; - - var getParentPickerObject = function(obj) { - var $obj = $(obj); - var $picker; - if ($obj.hasClass('datepicker')) { - $picker = $obj; - } else { - var parents = $obj.parents(); - for (var i = 0; i < parents.length; i++) { - if ($(parents[i]).hasClass('datepicker')) { - $picker = $(parents[i]); - } - } - } - return $picker; - }; - - var getPickersInputObject = function($obj) { - var $picker = getParentPickerObject($obj); - if ($picker.data("inputObjectId") != null) { - return $(InputObjects[$picker.data("inputObjectId")]); - } - return null; - } - var beforeMonth = function($obj) { - var $picker = getParentPickerObject($obj); - var date = getPickedDate($picker); - var targetMonth_lastDay = new Date(date.getYear() + 1900, date.getMonth(), 0).getDate(); - if (targetMonth_lastDay < date.getDate()) { - date.setDate(targetMonth_lastDay); - } - draw($picker, { - "isAnim": true, - "isOutputToInputObject": true - }, date.getYear() + 1900, date.getMonth() - 1, date.getDate(), date.getHours(), date.getMinutes()); - }; - - var nextMonth = function($obj) { - var $picker = getParentPickerObject($obj); - var date = getPickedDate($picker); - var targetMonth_lastDay = new Date(date.getYear() + 1900, date.getMonth() + 1, 0).getDate(); - if (targetMonth_lastDay < date.getDate()) { - date.setDate(targetMonth_lastDay); - } - draw($picker, { - "isAnim": true, - "isOutputToInputObject": true - }, date.getYear() + 1900, date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes()); - }; - - var getDate = function (str) { - var re = /^(\d{2,4})[-/](\d{1,2})[-/](\d{1,2}) (\d{1,2}):(\d{1,2})$/; - var m = re.exec(str); - // change year for 4 digits - if (m[1] < 99) { - var date = new Date(); - m[1] = parseInt(m[1]) + parseInt(date.getFullYear().toString().substr(0, 2) + "00"); - } - // return - return new Date(m[1], m[2] - 1, m[3], m[4], m[5]); - } - - var outputToInputObject = function($picker) { - var date = getPickedDate($picker); - var $inp = getPickersInputObject($picker); - var dateFormat = $picker.data("dateFormat"); - var locale = $picker.data("locale"); - var str = ""; - if ($inp == null) { - return; - } - - if (dateFormat == "default"){ - if(locale == "ja"){ - dateFormat = "YYYY/MM/DD hh:mm"; - }else{ - dateFormat = "YYYY-MM-DD hh:mm"; - } - } - - str = dateFormat; - var y = date.getYear() + 1900; - var m = date.getMonth() + 1; - var d = date.getDate(); - var hou = date.getHours(); - var min = date.getMinutes(); - - str = str.replace(/YYYY/gi, y) - .replace(/YY/g, y - 2000)/* century */ - .replace(/MM/g, zpadding(m)) - .replace(/M/g, m) - .replace(/DD/g, zpadding(d)) - .replace(/D/g, d) - .replace(/hh/g, zpadding(hou)) - .replace(/h/g, hou) - .replace(/mm/g, zpadding(min)) - .replace(/m/g, min); - $inp.val(str); - }; - - var getPickedDate = function($obj) { - var $picker = getParentPickerObject($obj); - return $picker.data("pickedDate"); - }; - - var zpadding = function(num) { - num = ("0" + num).slice(-2); - return num - }; - - var draw_date = function($picker, option, date) { - draw($picker, option, date.getYear() + 1900, date.getMonth(), date.getDate(), date.getHours(), date.getMinutes()); - }; - - var draw = function($picker, option, year, month, day, hour, min) { - var date = new Date(); - - if (hour != null) { - date = new Date(year, month, day, hour, min, 0); - } else if (year != null) { - date = new Date(year, month, day); - } else { - date = new Date(); - } - //console.log("dtpicker - draw()..." + year + "," + month + "," + day + " " + hour + ":" + min + " -> " + date); - - /* Read options */ - var isScroll = option.isAnim; /* It same with isAnim */ - - var isAnim = option.isAnim; - if($picker.data("animation") == false){ // If disabled by user option. - isAnim = false; - } - - var isOutputToInputObject = option.isOutputToInputObject; - - /* Read locale option */ - var locale = $picker.data("locale"); - var daysOfWeek = DAYS_OF_WEEK_EN; - if(locale == "ja"){ - daysOfWeek = DAYS_OF_WEEK_JA; - } - - /* Calculate dates */ - var todayDate = new Date(); - var firstWday = new Date(date.getYear() + 1900, date.getMonth(), 1).getDay(); - var lastDay = new Date(date.getYear() + 1900, date.getMonth() + 1, 0).getDate(); - var beforeMonthLastDay = new Date(date.getYear() + 1900, date.getMonth(), 0).getDate(); - var dateBeforeMonth = new Date(date.getYear() + 1900, date.getMonth(), 0); - var dateNextMonth = new Date(date.getYear() + 1900, date.getMonth() + 2, 0); - - /* Collect each part */ - var $header = $picker.children('.datepicker_header'); - var $inner = $picker.children('.datepicker_inner_container'); - var $calendar = $picker.children('.datepicker_inner_container').children('.datepicker_calendar'); - var $table = $calendar.children('.datepicker_table'); - var $timelist = $picker.children('.datepicker_inner_container').children('.datepicker_timelist'); - - /* Grasp a point that will be changed */ - var changePoint = ""; - var oldDate = getPickedDate($picker); - if(oldDate != null){ - if(oldDate.getMonth() != date.getMonth() || oldDate.getDate() != date.getDate()){ - changePoint = "calendar"; - } else if (oldDate.getHours() != date.getHours() || oldDate.getMinutes() != date.getMinutes()){ - if(date.getMinutes() == 0 || date.getMinutes() == 30){ - changePoint = "timelist"; - } - } - } - - /* Save newly date to Picker data */ - $($picker).data("pickedDate", date); - - /* Fade-out animation */ - if (isAnim == true) { - if(changePoint == "calendar"){ - $calendar.stop().queue([]); - $calendar.fadeTo("fast", 0.8); - }else if(changePoint == "timelist"){ - $timelist.stop().queue([]); - $timelist.fadeTo("fast", 0.8); - } - } - /* Remind timelist scroll state */ - var drawBefore_timeList_scrollTop = $timelist.scrollTop(); - - /* New timelist */ - var timelist_activeTimeCell_offsetTop = -1; - - /* Header ----- */ - $header.children().remove(); - var $link_before_month = $(''); - $link_before_month.text('<'); - $link_before_month.click(function() { - beforeMonth($picker); - }); - - var $now_month = $(''); - if(locale == "en"){ - $now_month.text((date.getYear() + 1900) + " - " + MONTHS_EN[date.getMonth()]); - }else if(locale == "ja"){ - $now_month.text((date.getYear() + 1900) + " / " + zpadding(date.getMonth() + 1)); - } - - var $link_next_month = $(''); - $link_next_month.text('>'); - $link_next_month.click(function() { - nextMonth($picker); - }); - - $header.append($link_before_month); - $header.append($now_month); - $header.append($link_next_month); - - /* Calendar > Table ----- */ - $table.children().remove(); - var $tr = $(''); - $table.append($tr); - - /* Output wday cells */ - for (var i = 0; i < 7; i++) { - var $td = $(''); - $td.text(daysOfWeek[i]); - $tr.append($td); - } - - /* Output day cells */ - var cellNum = Math.ceil((firstWday + lastDay) / 7) * 7; - for (var i = 0; i < cellNum; i++) { - var realDay = i + 1 - firstWday; - if (i % 7 == 0) { - $tr = $(''); - $table.append($tr); - } - - var $td = $(''); - $td.data("day", realDay); - - $tr.append($td); - - if (firstWday > i) {/* Before months day */ - $td.text(beforeMonthLastDay + realDay); - $td.addClass('day_another_month'); - $td.data("dateStr", dateBeforeMonth.getYear() + 1900 + "/" + (dateBeforeMonth.getMonth() + 1) + "/" + (beforeMonthLastDay + realDay)); - } else if (i < firstWday + lastDay) {/* Now months day */ - $td.text(realDay); - $td.data("dateStr", (date.getYear() + 1900) + "/" + (date.getMonth() + 1) + "/" + realDay); - } else {/* Next months day */ - $td.text(realDay - lastDay); - $td.addClass('day_another_month'); - $td.data("dateStr", dateNextMonth.getYear() + 1900 + "/" + (dateNextMonth.getMonth() + 1) + "/" + (realDay - lastDay)); - } - - if (i % 7 == 0) {/* Sunday */ - $td.addClass('wday_sun'); - } else if (i % 7 == 6) {/* Saturday */ - $td.addClass('wday_sat'); - } - - if (realDay == date.getDate()) {/* selected day */ - $td.addClass('active'); - } - - if (date.getMonth() == todayDate.getMonth() && realDay == todayDate.getDate()) {/* today */ - $td.addClass('today'); - } - - /* Set event-handler to day cell */ - - $td.click(function() { - if ($(this).hasClass('hover')) { - $(this).removeClass('hover'); - } - $(this).addClass('active'); - - var $picker = getParentPickerObject($(this)); - var targetDate = new Date($(this).data("dateStr")); - var selectedDate = getPickedDate($picker); - draw($picker, { - "isAnim": false, - "isOutputToInputObject": true - }, targetDate.getYear() + 1900, targetDate.getMonth(), targetDate.getDate(), selectedDate.getHours(), selectedDate.getMinutes()); - }); - - $td.hover(function() { - if (! $(this).hasClass('active')) { - $(this).addClass('hover'); - } - }, function() { - if ($(this).hasClass('hover')) { - $(this).removeClass('hover'); - } - }); - } - - /* Timelist ----- */ - $timelist.children().remove(); - - /* Set height to Timelist (Calendar innerHeight - Calendar padding) */ - $timelist.css("height", $calendar.innerHeight() - 10 + 'px'); - - /* Output time cells */ - for (var hour = 0; hour < 24; hour++) { - for (var min = 0; min <= 30; min += 30) { - var $o = $('
'); - $o.addClass('timelist_item'); - $o.text(zpadding(hour) + ":" + zpadding(min)); - - $o.data("hour", hour); - $o.data("min", min); - - $timelist.append($o); - - if (hour == date.getHours() && min == date.getMinutes()) {/* selected time */ - $o.addClass('active'); - timelist_activeTimeCell_offsetTop = $o.offset().top; - } - - /* Set event handler to time cell */ - - $o.click(function() { - if ($(this).hasClass('hover')) { - $(this).removeClass('hover'); - } - $(this).addClass('active'); - - var $picker = getParentPickerObject($(this)); - var date = getPickedDate($picker); - var hour = $(this).data("hour"); - var min = $(this).data("min"); - draw($picker, { - "isAnim": false, - "isOutputToInputObject": true - }, date.getYear() + 1900, date.getMonth(), date.getDate(), hour, min); - }); - - $o.hover(function() { - if (! $(this).hasClass('active')) { - $(this).addClass('hover'); - } - }, function() { - if ($(this).hasClass('hover')) { - $(this).removeClass('hover'); - } - }); - } - } - - /* Scroll the timelist */ - if(isScroll == true){ - /* Scroll to new active time-cell position */ - $timelist.scrollTop(timelist_activeTimeCell_offsetTop - $timelist.offset().top); - }else{ - /* Scroll to position that before redraw. */ - $timelist.scrollTop(drawBefore_timeList_scrollTop); - } - - /* Fade-in animation */ - if (isAnim == true) { - if(changePoint == "calendar"){ - $calendar.fadeTo("fast", 1.0); - }else if(changePoint == "timelist"){ - $timelist.fadeTo("fast", 1.0); - } - } - - /* Output to InputForm */ - if (isOutputToInputObject == true) { - outputToInputObject($picker); - } - }; - - var init = function($obj, opt) { - /* Container */ - var $picker = $('
'); - $picker.addClass('datepicker') - $obj.append($picker); - - /* Set options data to container object */ - if (opt.inputObjectId != null) { - $picker.data("inputObjectId", opt.inputObjectId); - } - $picker.data("pickerId", PickerObjects.length); - $picker.data("dateFormat", opt.dateFormat); - $picker.data("locale", opt.locale); - $picker.data("animation", opt.animation); - - /* Header */ - var $header = $('
'); - $header.addClass('datepicker_header'); - $picker.append($header); - /* InnerContainer*/ - var $inner = $('
'); - $inner.addClass('datepicker_inner_container'); - $picker.append($inner); - /* Calendar */ - var $calendar = $('
'); - $calendar.addClass('datepicker_calendar'); - var $table = $(''); - $table.addClass('datepicker_table'); - $calendar.append($table); - $inner.append($calendar); - /* Timelist */ - var $timelist = $('
'); - $timelist.addClass('datepicker_timelist'); - $inner.append($timelist); - - /* Set event handler to picker */ - $picker.hover( - function(){ - ActivePickerId = $(this).data("pickerId"); - }, - function(){ - ActivePickerId = -1; - } - ); - - PickerObjects.push($picker); - - draw_date($picker, { - "isAnim": true, - "isOutputToInputObject": true - }, opt.current); - }; - - /** - * Initialize dtpicker - */ - $.fn.dtpicker = function(config) { - var date = new Date(); - var defaults = { - "inputObjectId": undefined, - "current": date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes(), - "dateFormat": "default", - "locale": "en", - "animation": true - }; - - var options = $.extend(defaults, config); - options.current = getDate(options.current); - return this.each(function(i) { - init($(this), options); - }); - }; - - /** - * Initialize dtpicker, append to Text input field - * */ - $.fn.appendDtpicker = function(config) { - var date = new Date(); - var defaults = { - "inline": false, - "current": date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes(), - "dateFormat": "default", - "locale": "en", - "animation": true - } - var options = $.extend(defaults, config); - return this.each(function(i) { - - /* Add input-field with inputsObjects array */ - var input = this; - var inputObjectId = InputObjects.length; - InputObjects.push(input); - - options.inputObjectId = inputObjectId; - - /* Current date */ - var date, strDate, strTime; - if($(input).val() != null && $(input).val() != ""){ - options.current = $(input).val(); - } - - /* Make parent-div for picker */ - var $d = $('
'); - if(options.inline == false){ - /* float mode */ - $d.css("position","absolute"); - } - $d.insertAfter(input); - - /* Initialize picker */ - - var pickerId = PickerObjects.length; - - var $picker_parent = $($d).dtpicker(options); // call dtpicker() method - - var $picker = $picker_parent.children('.datepicker'); - - /* Link input-field with picker*/ - $(input).data('pickerId', pickerId); - - /* Set event handler to input-field */ - - $(input).keyup(function() { - var $input = $(this); - var $picker = $(PickerObjects[$input.data('pickerId')]); - if ($input.val() != null && ( - $input.data('beforeVal') == null || - ( $input.data('beforeVal') != null && $input.data('beforeVal') != $input.val()) ) - ) { /* beforeValue == null || beforeValue != nowValue */ - var date = getDate($input.val()); - if (isNaN(date.getDate()) == false) {/* Valid format... */ - draw_date($picker, { - "isAnim":true, - "isOutputToInputObject":false - }, date); - } - } - $input.data('beforeVal',$input.val()) - }); - - $(input).change(function(){ - $(this).trigger('keyup'); - }); - - if(options.inline == true){ - /* inline mode */ - $picker.data('isInline',true); - }else{ - /* float mode */ - $picker.data('isInline',false); - $picker_parent.css({ - "zIndex": 100 - }); - $picker.css("width","auto"); - - /* Hide this picker */ - $picker.hide(); - - /* Set onClick event handler for input-field */ - $(input).click(function(){ - var $input = $(this); - var $picker = $(PickerObjects[$input.data('pickerId')]); - ActivePickerId = $input.data('pickerId'); - $picker.show(); - $picker.parent().css("top", $input.offset().top + $input.outerHeight() + 2 + "px"); - $picker.parent().css("left", $input.offset().left + "px"); - }); - } - }); -}; - -/* Set event handler to Body element, for hide a floated-picker */ -$(function(){ - $('body').click(function(){ - for(var i=0;i=1.7.2" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/mugifly/jquery-simple-datetimepicker/blob/master/LICENSE.txt" - } - ], - "files": ["jquery.simple-dtpicker.js"], - "description": "Date and time picker, simply.", - "keywords": ["date","time","picker","input","form","datepicker","timepicker"], - "homepage": "http://mugifly.github.com/jquery-simple-datetimepicker/", - "demo": "http://mugifly.github.com/jquery-simple-datetimepicker/jquery.simple-dtpicker.html", - "docs": "https://github.com/mugifly/jquery-simple-datetimepicker/blob/master/README.md", - "bugs": "https://github.com/mugifly/jquery-simple-datetimepicker/issues" -}