├── src ├── mg-datepicker.jade ├── app.coffee ├── datepicker-modal.jade ├── datepicker-modal.scss ├── datepicker-modal.controller.coffee ├── datepicker-modal.service.coffee ├── mg-datepicker.scss ├── calendar.service.coffee └── mg-datepicker.directive.coffee ├── release ├── mg-datepicker.html ├── datepicker-modal.html ├── datepicker-modal.css.map ├── date-period-picker-templates.js ├── datepicker-modal.css ├── mg-datepicker.css.map ├── mg-datepicker.css └── date-period-picker.js ├── .DS_Store ├── .gitignore ├── resource └── image │ └── popup-screen-capture.png ├── package.json ├── COPYING ├── bower.json ├── Gruntfile.js ├── README.md └── LICENSE /src/mg-datepicker.jade: -------------------------------------------------------------------------------- 1 | .datepicker -------------------------------------------------------------------------------- /release/mg-datepicker.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /src/app.coffee: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | angular.module 'datePeriodPicker', [ ] -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/date-period-picker/master/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | 3 | .idea 4 | .sass-cache 5 | node_modules -------------------------------------------------------------------------------- /resource/image/popup-screen-capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/date-period-picker/master/resource/image/popup-screen-capture.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "date-period-picker", 3 | "devDependencies" : { 4 | "grunt": "*", 5 | "grunt-angular-templates": "^0.5.7", 6 | "grunt-contrib-coffee": "*", 7 | "grunt-contrib-jade": "*", 8 | "grunt-contrib-sass": "*", 9 | "node-markdown": "^0.1.1" 10 | } 11 | } -------------------------------------------------------------------------------- /src/datepicker-modal.jade: -------------------------------------------------------------------------------- 1 | #custom-modal(ng-click="close()", ng-show="options.display") 2 | #overlay(ng-click="$event.stopPropagation()" ng-style="options.overlayZIndex") 3 | mg-datepicker(mg-start="start", mg-end="end", mg-select="close()", mg-button-name="buttonName", mg-callback="callback", mg-options="options") 4 | #fade(ng-style="options.fadeZIndex") 5 | a.btn_calendar_close(href='javascript:;') 6 | span.blind 달력 닫기 -------------------------------------------------------------------------------- /release/datepicker-modal.html: -------------------------------------------------------------------------------- 1 |
달력 닫기
-------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright 2016 NAVER Corp. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /release/datepicker-modal.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "mappings": "AAAA,QAAS;EACP,QAAQ,EAAE,KAAK;EACf,IAAI,EAAE,GAAG;EACT,KAAK,EAAE,GAAG;EACV,GAAG,EAAE,IAAI;EACT,MAAM,EAAC,GAAG;EACV,gBAAgB,EAAE,OAAO;EACzB,OAAO,EAAE,GAAG;EACZ,QAAQ,EAAE,IAAI;;AAGhB,KAAM;EACJ,QAAQ,EAAE,KAAK;EACf,IAAI,EAAE,EAAE;EACR,GAAG,EAAE,EAAE;EACP,gBAAgB,EAAE,KAAK;EACvB,OAAO,EAAE,GAAG;EACZ,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,EAAE;;AAGb,yBAA0B;EACxB,OAAO,EAAE,KAAK;EACd,QAAQ,EAAE,KAAK;EACf,KAAK,EAAE,IAAI;EACX,GAAG,EAAE,IAAI;EACT,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,gBAAgB,EAAE,4CAA4C;EAC9D,iBAAiB,EAAE,SAAS;EAC5B,uBAAuB,EAAE,WAAW;EACpC,eAAe,EAAE,WAAW;EAC5B,mBAAmB,EAAE,YAAY", 4 | "sources": ["../src/datepicker-modal.scss"], 5 | "names": [], 6 | "file": "datepicker-modal.css" 7 | } 8 | -------------------------------------------------------------------------------- /src/datepicker-modal.scss: -------------------------------------------------------------------------------- 1 | #overlay { 2 | position: fixed; 3 | left: 5px; 4 | right: 5px; 5 | top: 53px; 6 | bottom:5px; 7 | background-color: #ffffff; 8 | z-index: 100; 9 | overflow: auto; 10 | } 11 | 12 | #fade { 13 | position: fixed; 14 | left: 0%; 15 | top: 0%; 16 | background-color: black; 17 | opacity: .70; 18 | width: 100%; 19 | height: 100%; 20 | z-index: 90; 21 | } 22 | 23 | #fade .btn_calendar_close { 24 | display: block; 25 | position: fixed; 26 | right: 10px; 27 | top: 25px; 28 | z-index: 3001; 29 | width: 20px; 30 | height: 20px; 31 | background-image: url("/hotels/assets/images/sp_hotel_v1.png"); 32 | background-repeat: no-repeat; 33 | -webkit-background-size: 235px 222px; 34 | background-size: 235px 222px; 35 | background-position: -71px -171px; 36 | } -------------------------------------------------------------------------------- /release/date-period-picker-templates.js: -------------------------------------------------------------------------------- 1 | angular.module('datePeriodPicker').run(['$templateCache', function($templateCache) { 2 | 'use strict'; 3 | 4 | $templateCache.put('release/datepicker-modal.html', 5 | "
달력 닫기
" 6 | ); 7 | 8 | 9 | $templateCache.put('release/mg-datepicker.html', 10 | "
" 11 | ); 12 | 13 | }]); 14 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "date-period-picker", 3 | "version": "0.3.30", 4 | "homepage": "https://github.com/kccho/date-picker", 5 | "authors": [ 6 | "seunglak", 7 | "kccho ", 8 | "comcode " 9 | ], 10 | "description": "Angular directive of Scrollable datepicker.", 11 | "main": ["release/date-period-picker.js", "release/date-period-picker-templates.js", "release/datepicker-modal.css", "release/mg-datepicker.css"], 12 | "moduleType": [], 13 | "keywords": [ 14 | "date", 15 | "picker", 16 | "calendar" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "tests" 25 | ], 26 | "dependencies": { 27 | "angular-modal-service": "~0.6.9" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /release/datepicker-modal.css: -------------------------------------------------------------------------------- 1 | #overlay { 2 | position: fixed; 3 | left: 5px; 4 | right: 5px; 5 | top: 53px; 6 | bottom: 5px; 7 | background-color: #ffffff; 8 | z-index: 100; 9 | overflow: auto; } 10 | 11 | #fade { 12 | position: fixed; 13 | left: 0%; 14 | top: 0%; 15 | background-color: black; 16 | opacity: .70; 17 | width: 100%; 18 | height: 100%; 19 | z-index: 90; } 20 | 21 | #fade .btn_calendar_close { 22 | display: block; 23 | position: fixed; 24 | right: 10px; 25 | top: 25px; 26 | z-index: 3001; 27 | width: 20px; 28 | height: 20px; 29 | background-image: url("/hotels/assets/images/sp_hotel_v1.png"); 30 | background-repeat: no-repeat; 31 | -webkit-background-size: 235px 222px; 32 | background-size: 235px 222px; 33 | background-position: -71px -171px; } 34 | 35 | /*# sourceMappingURL=datepicker-modal.css.map */ 36 | -------------------------------------------------------------------------------- /src/datepicker-modal.controller.coffee: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | app = angular.module 'datePeriodPicker' 4 | app.controller 'DatepickerModalController', ['$scope', 'close', 'start', 'end', 'buttonName', 'callback', 'options', ($scope, close, start, end, buttonName, callback, options) -> 5 | if start? then $scope.start = new Date start.getTime() 6 | if end? then $scope.end = new Date end.getTime() 7 | if buttonName? then $scope.buttonName = buttonName 8 | if callback? then $scope.callback = callback 9 | $scope.options = options 10 | $scope.close = -> 11 | $scope.callback('close') 12 | if options.project == 'flights' # flights 13 | close({ 14 | trip: $scope.options.trip, 15 | sdate0: $scope.options.sdate0, 16 | sdate1: $scope.options.sdate1, 17 | sdate2: $scope.options.sdate2 18 | }) 19 | else 20 | close({start:$scope.start, end:$scope.end}) 21 | if !options.display 22 | close(null, 200) 23 | $scope.$on '$locationChangeStart', (event, next, current) -> 24 | if options.display == 1 25 | $scope.callback('close') 26 | close() 27 | ] 28 | -------------------------------------------------------------------------------- /src/datepicker-modal.service.coffee: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | app = angular.module 'datePeriodPicker' 4 | app.service 'DatepickerModalService', ['ModalService', '$q', (ModalService, $q) -> 5 | # use preload before using show in order to improve 6 | preload: (start, end, options) -> 7 | options.display = 0 8 | ModalService.showModal( 9 | templateUrl: 'release/datepicker-modal.html' 10 | controller: 'DatepickerModalController' 11 | inputs: 12 | start: start 13 | end: end 14 | buttonName: null 15 | callback: null 16 | options: options 17 | ) 18 | 19 | showModal: (start, end, buttonName, callback, options) -> 20 | options.display = 1 21 | deferred = $q.defer() 22 | ModalService.showModal( 23 | templateUrl: 'release/datepicker-modal.html' 24 | controller: 'DatepickerModalController' 25 | inputs: 26 | start: start 27 | end: end 28 | buttonName: buttonName 29 | callback: callback 30 | options: options 31 | ).then (modal) -> 32 | modal.close.then (result) -> 33 | if result then deferred.resolve result else deferred.reject() 34 | deferred.promise 35 | 36 | show: (start, end, callback, options) -> 37 | this.showModal(start, end, null, callback, options) 38 | 39 | checkin: (start, end, options) -> 40 | this.showModal(start, end, 'checkin', callback, options) 41 | 42 | checkout: (start, end, options) -> 43 | this.showModal(start, end, 'checkout', callback, options) 44 | ] 45 | -------------------------------------------------------------------------------- /release/mg-datepicker.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "mappings": "AACE,kBAAO;EACL,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,WAAW;EACpB,UAAU,EAAE,OAAO;EACnB,aAAa,EAAE,iBAAiB;EAChC,UAAU,EAAE,MAAM;EAClB,WAAW,EAAE,MAAM;AAErB,wBAAa;EACX,OAAO,EAAE,YAAY;EACrB,QAAQ,EAAE,QAAQ;EAClB,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,IAAI;EACjB,WAAW,EAAE,GAAG;EAChB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,OAAO;EAEf,8BAAM;IACJ,MAAM,EAAE,OAAO;IACf,WAAW,EAAE,MAAM;AAGvB,kBAAO;EACL,OAAO,EAAE,KAAK;EACd,QAAQ,EAAE,QAAQ;EAClB,YAAY,EAAE,KAAK;EACnB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,WAAW;AAErB,sBAAW;EACT,cAAc,EAAE,IAAI;EACpB,SAAS,EAAE,GAAG;EACd,WAAW,EAAE,IAAI;EACjB,WAAW,EAAE,GAAG;EAChB,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,MAAM;AAEpB,oBAAS;EACP,UAAU,EAAE,MAAM;EAClB,cAAc,EAAE,GAAG;EAEnB,yBAAK;IACH,KAAK,EAAE,IAAI;EAEb,yBAAK;IACH,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,GAAG;EAElB,0BAAM;IACJ,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,SAAS;IAElB,+BAAK;MACH,OAAO,EAAE,KAAK;MACd,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,KAAK;MACd,MAAM,EAAE,MAAM;MACd,aAAa,EAAE,GAAG;MAClB,SAAS,EAAE,IAAI;MACf,WAAW,EAAE,IAAI;IAEnB,+BAAK;MACH,OAAO,EAAE,KAAK;MACd,SAAS,EAAE,IAAI;MACf,WAAW,EAAE,IAAI;MACjB,WAAW,EAAE,GAAG;EAIlB,+BAAK;IACH,UAAU,EAAE,OAAO;IACnB,KAAK,EAAE,IAAI;EAEb,+BAAK;IACH,KAAK,EAAE,OAAO;EAIhB,iCAAK;IACH,KAAK,EAAE,OAAO;EAEhB,iCAAK;IACH,KAAK,EAAE,OAAO;EAGlB,6BAAW;IACT,KAAK,EAAE,IAAI;IAEX,kCAAK;MACH,KAAK,EAAE,IAAI;EAGf,qCAAmB;IACjB,UAAU,EAAE,OAAO;EAErB,kCAAgB;IACd,KAAK,EAAE,OAAO;EAEhB,gCAAc;IACZ,KAAK,EAAE,OAAO;EAEhB,6BAAW;IACT,UAAU,EAAE,OAAO;IAEnB,kCAAK;MACH,KAAK,EAAE,IAAI;IAEb,kCAAK;MACH,KAAK,EAAE,IAAI", 4 | "sources": ["../src/mg-datepicker.scss"], 5 | "names": [], 6 | "file": "mg-datepicker.css" 7 | } 8 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | //var markdown = require('node-markdown').Markdown; 4 | //var fs = require('fs'); 5 | 6 | module.exports = function(grunt) { 7 | //change coffeescript to js 8 | grunt.loadNpmTasks('grunt-contrib-jade'); 9 | grunt.loadNpmTasks('grunt-contrib-coffee'); 10 | grunt.loadNpmTasks('grunt-contrib-sass'); 11 | grunt.loadNpmTasks('grunt-angular-templates'); 12 | 13 | grunt.initConfig({ 14 | coffee: { 15 | compile: { 16 | files: { 17 | 'release/date-period-picker.js': ['src/*.coffee'], 18 | } 19 | } 20 | }, 21 | jade: { 22 | compile: { 23 | files: { 24 | "release/datepicker-modal.html": "src/datepicker-modal.jade", 25 | "release/mg-datepicker.html": "src/mg-datepicker.jade" 26 | } 27 | } 28 | }, 29 | sass: { // Task 30 | compile: { // Target 31 | files: { // Dictionary of files 32 | 'release/datepicker-modal.css': 'src/datepicker-modal.scss', // 'destination': 'source' 33 | 'release/mg-datepicker.css': 'src/mg-datepicker.scss' 34 | } 35 | } 36 | }, 37 | ngtemplates: { 38 | datePeriodPicker: { 39 | src: 'release/*.html', 40 | dest: 'release/date-period-picker-templates.js' 41 | } 42 | } 43 | }); 44 | 45 | grunt.registerTask('default', ["jade", "coffee", "sass", "ngtemplates"]); 46 | 47 | return grunt; 48 | }; 49 | 50 | 51 | -------------------------------------------------------------------------------- /release/mg-datepicker.css: -------------------------------------------------------------------------------- 1 | .datepicker .title { 2 | position: relative; 3 | padding: 11px 0 28px; 4 | background: #f7f7f9; 5 | border-bottom: 1px solid #ecedf0; 6 | text-align: center; 7 | font-weight: normal; } 8 | .datepicker .title_label { 9 | display: inline-block; 10 | position: relative; 11 | font-size: 21px; 12 | line-height: 25px; 13 | font-weight: 300; 14 | color: #555; 15 | cursor: pointer; } 16 | .datepicker .title_label label { 17 | cursor: pointer; 18 | font-weight: normal; } 19 | .datepicker .table { 20 | display: table; 21 | position: relative; 22 | table-layout: fixed; 23 | width: 100%; 24 | margin: -18px 0 6px; } 25 | .datepicker .header th { 26 | padding-bottom: 12px; 27 | font-size: 9px; 28 | line-height: 12px; 29 | font-weight: 400; 30 | color: #999; 31 | text-align: center; } 32 | .datepicker .body td { 33 | text-align: center; 34 | vertical-align: top; } 35 | .datepicker .body td .num { 36 | color: #000; } 37 | .datepicker .body td .txt { 38 | display: block; 39 | font-size: 10px; 40 | line-height: 16px; 41 | font-weight: 500; } 42 | .datepicker .body td .cell { 43 | display: block; 44 | min-height: 38px; 45 | padding: 3px 0 4px; } 46 | .datepicker .body td .cell .num { 47 | display: block; 48 | width: 22px; 49 | padding: 3px 0; 50 | margin: 0 auto; 51 | border-radius: 50%; 52 | font-size: 14px; 53 | line-height: 16px; } 54 | .datepicker .body td .cell .txt { 55 | display: block; 56 | font-size: 10px; 57 | line-height: 16px; 58 | font-weight: 500; } 59 | .datepicker .body td.today .num { 60 | background: #f05050; 61 | color: #fff; } 62 | .datepicker .body td.today .txt { 63 | color: #f05050; } 64 | .datepicker .body td.holiday .num { 65 | color: #f05050; } 66 | .datepicker .body td.holiday .txt { 67 | color: #f05050; } 68 | .datepicker .body td.disabled { 69 | color: #bbb; } 70 | .datepicker .body td.disabled .num { 71 | color: #bbb; } 72 | .datepicker .body td.between-selected { 73 | background: #e0f8e7; } 74 | .datepicker .body td.saturday .num { 75 | color: #379afc; } 76 | .datepicker .body td.sunday .num { 77 | color: #f05050; } 78 | .datepicker .body td.selected { 79 | background: #00c73c; } 80 | .datepicker .body td.selected .num { 81 | color: #fff; } 82 | .datepicker .body td.selected .txt { 83 | color: #fff; } 84 | 85 | /*# sourceMappingURL=mg-datepicker.css.map */ 86 | -------------------------------------------------------------------------------- /src/mg-datepicker.scss: -------------------------------------------------------------------------------- 1 | .datepicker{ 2 | .title { 3 | position: relative; 4 | padding: 11px 0 28px; 5 | background: #f7f7f9; 6 | border-bottom: 1px solid #ecedf0; 7 | text-align: center; 8 | font-weight: normal; 9 | } 10 | .title_label { 11 | display: inline-block; 12 | position: relative; 13 | font-size: 21px; 14 | line-height: 25px; 15 | font-weight: 300; 16 | color: #555; 17 | cursor: pointer; 18 | 19 | label { 20 | cursor: pointer; 21 | font-weight: normal; 22 | } 23 | } 24 | .table { 25 | display: table; 26 | position: relative; 27 | table-layout: fixed; 28 | width: 100%; 29 | margin: -18px 0 6px; 30 | } 31 | .header th { 32 | padding-bottom: 12px; 33 | font-size: 9px; 34 | line-height: 12px; 35 | font-weight: 400; 36 | color: #999; 37 | text-align: center; 38 | } 39 | .body td { 40 | text-align: center; 41 | vertical-align: top; 42 | 43 | .num { 44 | color: #000; 45 | } 46 | .txt { 47 | display: block; 48 | font-size: 10px; 49 | line-height: 16px; 50 | font-weight: 500; 51 | } 52 | .cell { 53 | display: block; 54 | min-height: 38px; 55 | padding: 3px 0 4px; 56 | 57 | .num { 58 | display: block; 59 | width: 22px; 60 | padding: 3px 0; 61 | margin: 0 auto; 62 | border-radius: 50%; 63 | font-size: 14px; 64 | line-height: 16px; 65 | } 66 | .txt { 67 | display: block; 68 | font-size: 10px; 69 | line-height: 16px; 70 | font-weight: 500; 71 | } 72 | } 73 | &.today { 74 | .num { 75 | background: #f05050; 76 | color: #fff; 77 | } 78 | .txt { 79 | color: #f05050; 80 | } 81 | } 82 | &.holiday { 83 | .num { 84 | color: #f05050; 85 | } 86 | .txt { 87 | color: #f05050; 88 | } 89 | } 90 | &.disabled { 91 | color: #bbb; 92 | 93 | .num { 94 | color: #bbb; 95 | } 96 | } 97 | &.between-selected { 98 | background: #e0f8e7; 99 | } 100 | &.saturday .num { 101 | color: #379afc; 102 | } 103 | &.sunday .num { 104 | color: #f05050; 105 | } 106 | &.selected { 107 | background: #00c73c; 108 | 109 | .num { 110 | color: #fff; 111 | } 112 | .txt { 113 | color: #fff; 114 | } 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # date-picker 2 | An Angular directive of Scrollable datepicker. 3 | 4 | ## Overview 5 | A calendar is a widely used component to filter search results. 6 | This directive makes it easier to pick a date period without a whole lot of settings 7 | 8 | ## Screenshots 9 | ![popup_screen_shot](/resource/image/popup-screen-capture.png) 10 | 11 | 12 | ## Usage 13 | 1. include modules, service 14 | - include modules: datePeriodPicker, angularModalService 15 | ex) in app.js, angular.module('myApp', ['ngCookies', ..., 'datePeriodPicker', 'angularModalService']) 16 | - add service: DatepickerModalService 17 | ex) in filter.controller.js, angular.module('yourApp').controller('FilterController', function($scope, ..., DatepickerModalService) 18 | 19 | 2. define options 20 | 21 | 3. call DatepickerModalService.show 22 | parameters: 23 | - startDate: a variable that will be used as startDate 24 | - endDate: a variable that will be used as endDate 25 | - callback(eventName): a callback function, which will be called when a date is selected 26 | receiving callback will receive eventName such as 'start'(for start date selection), 'end'(for start date selection) 27 | - datePickerOptions:
28 | limitNight: maximum nights that a user can select as a period
29 | selectableDays: selectable days from today
30 | (ex: selectableDays:90 means that a user can select any date between today and today + 90 days).
31 | Visible months are based on this selectable days as well.
32 | 33 | 34 | ###html
35 | ``` 36 | Picke a Date! 37 | ``` 38 | 39 | ####javascript
40 | ```javascript 41 | $scope.startDate = null 42 | $scope.endDate = null 43 | 44 | var datePickerOptions = { 45 | enableKoreanCalendar: true, 46 | limitNights: 13, 47 | selectableDays: 90, 48 | // holidayUrl: `${appConfig.apiUrlPrefix}/common/holidays`, 49 | checkInString: '입실', 50 | checkOutString: '퇴실' 51 | } 52 | 53 | $scope.datepickerCallback = function(eventName) { 54 | if (eventName === 'start') { 55 | // start date selected 56 | } else if (eventName === 'end') { 57 | // end date selected 58 | } 59 | }; 60 | 61 | 62 | $scope.showDatepicker = function() { 63 | $scope.isBottomHidden = true; 64 | return DatepickerModalService.show($scope.startDate, $scope.endDate, $scope.datepickerCallback, datePickerOptions).then(function(result) { 65 | $scope.startDate = result.start; 66 | return $scope.endDate = result.end; 67 | }).then(function() { 68 | // dates selected 69 | }, function(err) { 70 | // modal dismissed 71 | }); 72 | }; 73 | ``` 74 | 75 | ## limitation 76 | HTML and CSS files are fixed, and the options are limited. 77 | 78 | 79 | ## License 80 | See [LICENSE](LICENSE) for full license text. 81 | 82 | ``` 83 | Copyright 2016 NAVER Corp. 84 | 85 | Licensed under the Apache License, Version 2.0 (the "License"); 86 | you may not use this file except in compliance with the License. 87 | You may obtain a copy of the License at 88 | 89 | http://www.apache.org/licenses/LICENSE-2.0 90 | 91 | Unless required by applicable law or agreed to in writing, software 92 | distributed under the License is distributed on an "AS IS" BASIS, 93 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 94 | See the License for the specific language governing permissions and 95 | limitations under the License. 96 | ``` 97 | 98 | ## Contact 99 | Please let us know, if you have any questions or suggestions. Also, if you are happy to use this directive, just share us the story so that we can make this component better! 100 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/calendar.service.coffee: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | app = angular.module 'datePeriodPicker' 4 | app.service 'Calendar', ['$http', '$filter', ($http, $filter) -> 5 | # Get holidays 6 | todayDate = new Date() 7 | loadHolidaySuccess = false 8 | holidays = { "2016-03-01 00:00:00":{"name":"삼일절","type":"holiday"},"2016-03-05 00:00:00":{"name":"경칩","type":"solarterms"},"2016-03-14 00:00:00":{"name":"화이트데이","type":"etc"},"2016-03-20 00:00:00":{"name":"춘분","type":"solarterms"},"2016-04-04 00:00:00":{"name":"청명","type":"solarterms"},"2016-04-05 00:00:00":{"name":"한식","type":"solarterms"},"2016-04-13 00:00:00":{"name":"20대 국회의원선거","type":"holiday"},"2016-04-20 00:00:00":{"name":"곡우","type":"solarterms"},"2016-05-01 00:00:00":{"name":"근로자의날","type":"national"},"2016-05-05 00:00:00":{"name":"입하","type":"solarterms"},"2016-05-08 00:00:00":{"name":"어버이날","type":"national"},"2016-05-10 00:00:00":{"name":"유권자의날","type":"national"},"2016-05-14 00:00:00":{"name":"석가탄신일","type":"holiday"},"2016-05-15 00:00:00":{"name":"스승의날","type":"national"},"2016-05-20 00:00:00":{"name":"소만","type":"solarterms"},"2016-06-05 00:00:00":{"name":"망종","type":"solarterms"},"2016-06-06 00:00:00":{"name":"현충일","type":"holiday"},"2016-06-09 00:00:00":{"name":"단오","type":"solarterms"},"2016-06-21 00:00:00":{"name":"하지","type":"solarterms"},"2016-06-25 00:00:00":{"name":"6.25 한국 전쟁","type":"national"},"2016-07-07 00:00:00":{"name":"소서","type":"solarterms"},"2016-07-17 00:00:00":{"name":"초복","type":"solarterms"},"2016-07-22 00:00:00":{"name":"대서","type":"solarterms"},"2016-07-27 00:00:00":{"name":"중복","type":"solarterms"},"2016-08-07 00:00:00":{"name":"입추","type":"solarterms"},"2016-08-15 00:00:00":{"name":"광복절","type":"holiday"},"2016-08-16 00:00:00":{"name":"말복","type":"solarterms"},"2016-08-23 00:00:00":{"name":"처서","type":"solarterms"},"2016-09-07 00:00:00":{"name":"백로","type":"solarterms"},"2016-09-14 00:00:00":{"name":"추석","type":"consecutive"},"2016-09-15 00:00:00":{"name":"추석","type":"holiday"},"2016-09-16 00:00:00":{"name":"추석","type":"consecutive"},"2016-09-22 00:00:00":{"name":"추분","type":"solarterms"},"2016-10-03 00:00:00":{"name":"개천절","type":"holiday"},"2016-10-08 00:00:00":{"name":"한로","type":"solarterms"},"2016-10-09 00:00:00":{"name":"한글날","type":"holiday"},"2016-10-23 00:00:00":{"name":"상강","type":"solarterms"},"2016-11-07 00:00:00":{"name":"입동","type":"solarterms"},"2016-11-22 00:00:00":{"name":"소설","type":"solarterms"},"2016-12-07 00:00:00":{"name":"대설","type":"solarterms"},"2016-12-21 00:00:00":{"name":"동지","type":"solarterms"},"2016-12-25 00:00:00":{"name":"성탄절","type":"holiday"},"2017-01-01 00:00:00":{"name":"새해 첫날","type":"holiday"},"2017-01-05 00:00:00":{"name":"소한","type":"solarterms"},"2017-01-20 00:00:00":{"name":"대한","type":"solarterms"},"2017-01-27 00:00:00":{"name":"설날","type":"consecutive"},"2017-01-28 00:00:00":{"name":"설날","type":"holiday"},"2017-01-29 00:00:00":{"name":"설날","type":"consecutive"},"2017-01-30 00:00:00":{"name":"대체공휴일(설날)","type":"holiday"},"2017-02-04 00:00:00":{"name":"입춘","type":"solarterms"},"2017-02-11 00:00:00":{"name":"정월 대보름","type":"solarterms"},"2017-02-14 00:00:00":{"name":"밸런타인데이","type":"etc"},"2017-02-18 00:00:00":{"name":"우수","type":"solarterms"},"2017-03-01 00:00:00":{"name":"삼일절","type":"holiday"},"2017-03-05 00:00:00":{"name":"경칩","type":"solarterms"},"2017-03-14 00:00:00":{"name":"화이트데이","type":"etc"},"2017-03-20 00:00:00":{"name":"춘분","type":"solarterms"},"2017-04-04 00:00:00":{"name":"청명","type":"solarterms"},"2017-04-05 00:00:00":{"name":"한식","type":"solarterms"},"2017-04-20 00:00:00":{"name":"곡우","type":"solarterms"},"2017-05-01 00:00:00":{"name":"근로자의날","type":"national"},"2017-05-03 00:00:00":{"name":"석가탄신일","type":"holiday"},"2017-05-05 00:00:00":{"name":"입하","type":"solarterms"},"2017-05-08 00:00:00":{"name":"어버이날","type":"national"},"2017-05-10 00:00:00":{"name":"유권자의날","type":"national"},"2017-05-15 00:00:00":{"name":"스승의날","type":"national"},"2017-05-21 00:00:00":{"name":"소만","type":"solarterms"},"2017-05-30 00:00:00":{"name":"단오","type":"solarterms"},"2017-06-05 00:00:00":{"name":"망종","type":"solarterms"},"2017-06-06 00:00:00":{"name":"현충일","type":"holiday"},"2017-06-21 00:00:00":{"name":"하지","type":"solarterms"},"2017-06-25 00:00:00":{"name":"6.25 한국 전쟁","type":"national"},"2017-07-07 00:00:00":{"name":"소서","type":"solarterms"},"2017-07-12 00:00:00":{"name":"초복","type":"solarterms"},"2017-07-17 00:00:00":{"name":"제헌절","type":"national"},"2017-07-22 00:00:00":{"name":"중복","type":"solarterms"},"2017-07-23 00:00:00":{"name":"대서","type":"solarterms"},"2017-08-01 00:00:00":{"name":"말복","type":"solarterms"},"2017-08-07 00:00:00":{"name":"입추","type":"solarterms"},"2017-08-15 00:00:00":{"name":"광복절","type":"holiday"},"2017-08-23 00:00:00":{"name":"처서","type":"solarterms"},"2017-09-07 00:00:00":{"name":"백로","type":"solarterms"},"2017-09-23 00:00:00":{"name":"추분","type":"solarterms"},"2017-10-03 00:00:00":{"name":"개천절","type":"holiday"},"2017-10-04 00:00:00":{"name":"추석","type":"holiday"},"2017-10-05 00:00:00":{"name":"추석","type":"consecutive"},"2017-10-06 00:00:00":{"name":"대체공휴일(추석)","type":"holiday"},"2017-10-08 00:00:00":{"name":"한로","type":"solarterms"},"2017-10-09 00:00:00":{"name":"한글날","type":"holiday"},"2017-10-23 00:00:00":{"name":"상강","type":"solarterms"},"2017-11-07 00:00:00":{"name":"입동","type":"solarterms"},"2017-11-22 00:00:00":{"name":"소설","type":"solarterms"},"2017-12-07 00:00:00":{"name":"대설","type":"solarterms"},"2017-12-20 00:00:00":{"name":"19대 대통령선거","type":"holiday"},"2017-12-22 00:00:00":{"name":"동지","type":"solarterms"},"2017-12-25 00:00:00":{"name":"성탄절","type":"holiday"},"2018-01-01 00:00:00":{"name":"새해 첫날","type":"holiday"},"2018-01-05 00:00:00":{"name":"소한","type":"solarterms"},"2018-01-20 00:00:00":{"name":"대한","type":"solarterms"},"2018-02-04 00:00:00":{"name":"입춘","type":"solarterms"},"2018-02-14 00:00:00":{"name":"밸런타인데이","type":"etc"},"2018-02-15 00:00:00":{"name":"설날","type":"consecutive"},"2018-02-16 00:00:00":{"name":"설날","type":"holiday"},"2018-02-17 00:00:00":{"name":"설날","type":"consecutive"},"2018-02-19 00:00:00":{"name":"우수","type":"solarterms"},"2018-03-01 00:00:00":{"name":"삼일절","type":"holiday"},"2018-03-02 00:00:00":{"name":"정월 대보름","type":"solarterms"},"2018-03-06 00:00:00":{"name":"경칩","type":"solarterms"},"2018-03-14 00:00:00":{"name":"화이트데이","type":"etc"},"2018-03-21 00:00:00":{"name":"춘분","type":"solarterms"},"2018-04-05 00:00:00":{"name":"청명","type":"solarterms"},"2018-04-06 00:00:00":{"name":"한식","type":"solarterms"},"2018-04-20 00:00:00":{"name":"곡우","type":"solarterms"},"2018-05-01 00:00:00":{"name":"근로자의날","type":"national"},"2018-05-05 00:00:00":{"name":"입하","type":"solarterms"},"2018-05-08 00:00:00":{"name":"어버이날","type":"national"},"2018-05-10 00:00:00":{"name":"유권자의날","type":"national"},"2018-05-15 00:00:00":{"name":"스승의날","type":"national"},"2018-05-21 00:00:00":{"name":"소만","type":"solarterms"},"2018-05-22 00:00:00":{"name":"석가탄신일","type":"holiday"},"2018-06-06 00:00:00":{"name":"망종","type":"solarterms"},"2018-06-13 00:00:00":{"name":"2018 지방선거","type":"holiday"},"2018-06-18 00:00:00":{"name":"단오","type":"solarterms"},"2018-06-21 00:00:00":{"name":"하지","type":"solarterms"},"2018-06-25 00:00:00":{"name":"6.25 한국 전쟁","type":"national"},"2018-07-07 00:00:00":{"name":"소서","type":"solarterms"},"2018-07-17 00:00:00":{"name":"초복","type":"solarterms"},"2018-07-23 00:00:00":{"name":"대서","type":"solarterms"},"2018-07-27 00:00:00":{"name":"중복","type":"solarterms"},"2018-08-06 00:00:00":{"name":"말복","type":"solarterms"},"2018-08-07 00:00:00":{"name":"입추","type":"solarterms"},"2018-08-15 00:00:00":{"name":"광복절","type":"holiday"},"2018-08-23 00:00:00":{"name":"처서","type":"solarterms"},"2018-09-08 00:00:00":{"name":"백로","type":"solarterms"},"2018-09-23 00:00:00":{"name":"추분","type":"solarterms"},"2018-09-24 00:00:00":{"name":"추석","type":"holiday"},"2018-09-25 00:00:00":{"name":"추석","type":"consecutive"},"2018-10-03 00:00:00":{"name":"개천절","type":"holiday"},"2018-10-08 00:00:00":{"name":"한로","type":"solarterms"},"2018-10-09 00:00:00":{"name":"한글날","type":"holiday"},"2018-10-23 00:00:00":{"name":"상강","type":"solarterms"},"2018-11-07 00:00:00":{"name":"입동","type":"solarterms"},"2018-11-22 00:00:00":{"name":"소설","type":"solarterms"},"2018-12-07 00:00:00":{"name":"대설","type":"solarterms"},"2018-12-22 00:00:00":{"name":"동지","type":"solarterms"},"2018-12-25 00:00:00":{"name":"성탄절","type":"holiday"},"2019-01-01 00:00:00":{"name":"새해 첫날","type":"holiday"},"2019-01-06 00:00:00":{"name":"소한","type":"solarterms"},"2019-01-20 00:00:00":{"name":"대한","type":"solarterms"},"2019-02-04 00:00:00":{"name":"입춘","type":"solarterms"},"2019-02-05 00:00:00":{"name":"설날","type":"holiday"},"2019-02-06 00:00:00":{"name":"설날","type":"consecutive"},"2019-02-14 00:00:00":{"name":"밸런타인데이","type":"etc"},"2019-02-19 00:00:00":{"name":"정월 대보름","type":"solarterms"},"2019-03-01 00:00:00":{"name":"삼일절","type":"holiday"},"2019-03-06 00:00:00":{"name":"조합장선거","type":"solarterms"},"2019-03-14 00:00:00":{"name":"화이트데이","type":"etc"},"2019-03-21 00:00:00":{"name":"춘분","type":"solarterms"},"2019-04-05 00:00:00":{"name":"청명","type":"solarterms"},"2019-04-06 00:00:00":{"name":"한식","type":"solarterms"},"2019-04-20 00:00:00":{"name":"곡우","type":"solarterms"},"2019-05-01 00:00:00":{"name":"근로자의날","type":"national"},"2019-05-05 00:00:00":{"name":"어린이날","type":"holiday"},"2019-05-06 00:00:00":{"name":"입하","type":"solarterms"},"2019-05-08 00:00:00":{"name":"어버이날","type":"national"},"2019-05-10 00:00:00":{"name":"유권자의날","type":"national"},"2019-05-12 00:00:00":{"name":"석가탄신일","type":"holiday"},"2019-05-15 00:00:00":{"name":"스승의날","type":"national"},"2019-05-21 00:00:00":{"name":"소만","type":"solarterms"},"2019-06-06 00:00:00":{"name":"현충일","type":"holiday"},"2019-06-07 00:00:00":{"name":"단오","type":"solarterms"},"2019-06-25 00:00:00":{"name":"6.25 한국 전쟁","type":"national"},"2019-07-07 00:00:00":{"name":"소서","type":"solarterms"},"2019-07-17 00:00:00":{"name":"제헌절","type":"national"},"2019-07-23 00:00:00":{"name":"대서","type":"solarterms"},"2019-08-08 00:00:00":{"name":"입추","type":"solarterms"},"2019-08-15 00:00:00":{"name":"광복절","type":"holiday"},"2019-08-23 00:00:00":{"name":"처서","type":"solarterms"},"2019-09-08 00:00:00":{"name":"백로","type":"solarterms"},"2019-09-12 00:00:00":{"name":"추석","type":"consecutive"},"2019-09-13 00:00:00":{"name":"추석","type":"holiday"},"2019-09-14 00:00:00":{"name":"추석","type":"consecutive"},"2019-09-23 00:00:00":{"name":"추분","type":"solarterms"},"2019-10-03 00:00:00":{"name":"개천절","type":"holiday"},"2019-10-08 00:00:00":{"name":"한로","type":"solarterms"},"2019-10-09 00:00:00":{"name":"한글날","type":"holiday"},"2019-10-24 00:00:00":{"name":"상강","type":"solarterms"},"2019-11-08 00:00:00":{"name":"입동","type":"solarterms"},"2019-11-22 00:00:00":{"name":"소설","type":"solarterms"},"2019-12-07 00:00:00":{"name":"대설","type":"solarterms"},"2019-12-22 00:00:00":{"name":"동지","type":"solarterms"},"2019-12-25 00:00:00":{"name":"성탄절","type":"holiday"},"2020-01-01 00:00:00":{"name":"새해 첫날","type":"holiday"},"2020-01-06 00:00:00":{"name":"소한","type":"solarterms"},"2020-01-20 00:00:00":{"name":"대한","type":"solarterms"},"2020-01-24 00:00:00":{"name":"설날","type":"consecutive"},"2020-01-25 00:00:00":{"name":"설날","type":"holiday"},"2020-01-26 00:00:00":{"name":"설날","type":"consecutive"},"2020-02-04 00:00:00":{"name":"입춘","type":"solarterms"},"2020-02-08 00:00:00":{"name":"정월 대보름","type":"solarterms"},"2020-02-14 00:00:00":{"name":"밸런타인데이","type":"etc"},"2020-02-19 00:00:00":{"name":"우수","type":"solarterms"},"2020-03-01 00:00:00":{"name":"삼일절","type":"holiday"},"2020-03-05 00:00:00":{"name":"경칩","type":"solarterms"},"2020-03-14 00:00:00":{"name":"화이트데이","type":"etc"},"2020-03-20 00:00:00":{"name":"춘분","type":"solarterms"},"2020-04-04 00:00:00":{"name":"청명","type":"solarterms"},"2020-04-05 00:00:00":{"name":"한식","type":"solarterms"},"2020-04-15 00:00:00":{"name":"21대 국회의원선거","type":"holiday"},"2020-04-19 00:00:00":{"name":"곡우","type":"solarterms"},"2020-04-30 00:00:00":{"name":"석가탄신일","type":"holiday"},"2020-05-01 00:00:00":{"name":"근로자의날","type":"national"},"2020-05-05 00:00:00":{"name":"입하","type":"solarterms"},"2020-05-08 00:00:00":{"name":"어버이날","type":"national"},"2020-05-10 00:00:00":{"name":"유권자의날","type":"national"},"2020-05-15 00:00:00":{"name":"스승의날","type":"national"},"2020-05-20 00:00:00":{"name":"소만","type":"solarterms"},"2020-06-05 00:00:00":{"name":"망종","type":"solarterms"},"2020-06-06 00:00:00":{"name":"현충일","type":"holiday"},"2020-06-21 00:00:00":{"name":"하지","type":"solarterms"},"2020-06-25 00:00:00":{"name":"단오","type":"solarterms"},"2020-07-07 00:00:00":{"name":"소서","type":"solarterms"},"2020-07-16 00:00:00":{"name":"초복","type":"solarterms"},"2020-07-17 00:00:00":{"name":"제헌절","type":"national"},"2020-07-22 00:00:00":{"name":"대서","type":"solarterms"},"2020-07-26 00:00:00":{"name":"중복","type":"solarterms"},"2020-08-05 00:00:00":{"name":"말복","type":"solarterms"},"2020-08-07 00:00:00":{"name":"입추","type":"solarterms"},"2020-08-15 00:00:00":{"name":"광복절","type":"holiday"},"2020-08-23 00:00:00":{"name":"처서","type":"solarterms"},"2020-09-07 00:00:00":{"name":"백로","type":"solarterms"},"2020-09-22 00:00:00":{"name":"추분","type":"solarterms"},"2020-09-30 00:00:00":{"name":"추석","type":"consecutive"},"2020-10-01 00:00:00":{"name":"추석","type":"holiday"},"2020-10-02 00:00:00":{"name":"추석","type":"consecutive"},"2020-10-03 00:00:00":{"name":"개천절","type":"holiday"},"2020-10-08 00:00:00":{"name":"한로","type":"solarterms"},"2020-10-09 00:00:00":{"name":"한글날","type":"holiday"},"2020-10-23 00:00:00":{"name":"상강","type":"solarterms"},"2020-11-07 00:00:00":{"name":"입동","type":"solarterms"},"2020-11-22 00:00:00":{"name":"소설","type":"solarterms"},"2020-12-07 00:00:00":{"name":"대설","type":"solarterms"},"2020-12-21 00:00:00":{"name":"동지","type":"solarterms"},"2020-12-25 00:00:00":{"name":"성탄절","type":"holiday"},"2021-01-01 00:00:00":{"name":"새해 첫날","type":"holiday"},"2021-01-05 00:00:00":{"name":"소한","type":"solarterms"},"2021-01-20 00:00:00":{"name":"대한","type":"solarterms"},"2021-02-03 00:00:00":{"name":"입춘","type":"solarterms"},"2021-02-11 00:00:00":{"name":"설날","type":"consecutive"},"2021-02-12 00:00:00":{"name":"설날","type":"holiday"},"2021-02-13 00:00:00":{"name":"설날","type":"consecutive"},"2021-02-14 00:00:00":{"name":"밸런타인데이","type":"etc"},"2021-02-18 00:00:00":{"name":"우수","type":"solarterms"},"2021-02-26 00:00:00":{"name":"정월 대보름","type":"solarterms"},"2021-03-01 00:00:00":{"name":"삼일절","type":"holiday"},"2021-03-05 00:00:00":{"name":"경칩","type":"solarterms"},"2021-03-14 00:00:00":{"name":"화이트데이","type":"etc"},"2021-03-20 00:00:00":{"name":"춘분","type":"solarterms"},"2021-04-04 00:00:00":{"name":"청명","type":"solarterms"},"2021-04-05 00:00:00":{"name":"한식","type":"solarterms"},"2021-04-20 00:00:00":{"name":"곡우","type":"solarterms"},"2021-05-01 00:00:00":{"name":"근로자의날","type":"national"},"2021-05-05 00:00:00":{"name":"입하","type":"solarterms"},"2021-05-08 00:00:00":{"name":"어버이날","type":"national"},"2021-05-10 00:00:00":{"name":"유권자의날","type":"national"},"2021-05-15 00:00:00":{"name":"스승의날","type":"national"},"2021-05-19 00:00:00":{"name":"석가탄신일","type":"holiday"},"2021-05-21 00:00:00":{"name":"소만","type":"solarterms"},"2021-06-05 00:00:00":{"name":"망종","type":"solarterms"},"2021-06-06 00:00:00":{"name":"현충일","type":"holiday"},"2021-06-14 00:00:00":{"name":"단오","type":"solarterms"},"2021-06-21 00:00:00":{"name":"하지","type":"solarterms"},"2021-06-25 00:00:00":{"name":"6.25 한국 전쟁","type":"national"},"2021-07-07 00:00:00":{"name":"소서","type":"solarterms"},"2021-07-11 00:00:00":{"name":"초복","type":"solarterms"},"2021-07-17 00:00:00":{"name":"제헌절","type":"national"},"2021-07-21 00:00:00":{"name":"중복","type":"solarterms"},"2021-07-22 00:00:00":{"name":"대서","type":"solarterms"},"2021-07-31 00:00:00":{"name":"말복","type":"solarterms"},"2021-08-07 00:00:00":{"name":"입추","type":"solarterms"},"2021-08-15 00:00:00":{"name":"광복절","type":"holiday"},"2021-08-23 00:00:00":{"name":"처서","type":"solarterms"},"2021-09-07 00:00:00":{"name":"백로","type":"solarterms"},"2021-09-20 00:00:00":{"name":"추석","type":"consecutive"},"2021-09-21 00:00:00":{"name":"추석","type":"holiday"},"2021-09-22 00:00:00":{"name":"추석","type":"consecutive"},"2021-09-23 00:00:00":{"name":"추분","type":"solarterms"},"2021-10-03 00:00:00":{"name":"개천절","type":"holiday"},"2021-10-08 00:00:00":{"name":"한로","type":"solarterms"},"2021-10-09 00:00:00":{"name":"한글날","type":"holiday"},"2021-10-23 00:00:00":{"name":"상강","type":"solarterms"},"2021-11-07 00:00:00":{"name":"입동","type":"solarterms"},"2021-11-22 00:00:00":{"name":"소설","type":"solarterms"},"2021-12-07 00:00:00":{"name":"대설","type":"solarterms"},"2021-12-22 00:00:00":{"name":"동지","type":"solarterms"},"2021-12-25 00:00:00":{"name":"성탄절","type":"holiday"},"2022-01-01 00:00:00":{"name":"새해 첫날","type":"holiday"},"2022-01-05 00:00:00":{"name":"소한","type":"solarterms"},"2022-01-20 00:00:00":{"name":"대한","type":"solarterms"},"2022-01-31 00:00:00":{"name":"설날","type":"consecutive"},"2022-02-01 00:00:00":{"name":"설날","type":"holiday"},"2022-02-02 00:00:00":{"name":"설날","type":"consecutive"},"2022-02-04 00:00:00":{"name":"입춘","type":"solarterms"},"2022-02-14 00:00:00":{"name":"밸런타인데이","type":"etc"},"2022-02-15 00:00:00":{"name":"정월 대보름","type":"solarterms"},"2022-02-19 00:00:00":{"name":"우수","type":"solarterms"},"2022-03-01 00:00:00":{"name":"삼일절","type":"holiday"},"2022-03-05 00:00:00":{"name":"경칩","type":"solarterms"},"2022-03-14 00:00:00":{"name":"화이트데이","type":"etc"},"2022-03-21 00:00:00":{"name":"춘분","type":"solarterms"},"2022-04-05 00:00:00":{"name":"청명","type":"solarterms"},"2022-04-06 00:00:00":{"name":"한식","type":"solarterms"},"2022-04-20 00:00:00":{"name":"곡우","type":"solarterms"},"2022-05-01 00:00:00":{"name":"근로자의날","type":"national"},"2022-05-05 00:00:00":{"name":"입하","type":"solarterms"},"2022-05-08 00:00:00":{"name":"어버이날","type":"national"},"2022-05-10 00:00:00":{"name":"유권자의날","type":"national"},"2022-05-15 00:00:00":{"name":"스승의날","type":"national"},"2022-05-21 00:00:00":{"name":"소만","type":"solarterms"},"2022-06-01 00:00:00":{"name":"2022 지방선거","type":"holiday"},"2022-06-03 00:00:00":{"name":"단오","type":"solarterms"},"2022-06-06 00:00:00":{"name":"망종","type":"solarterms"},"2022-06-21 00:00:00":{"name":"하지","type":"solarterms"},"2022-06-25 00:00:00":{"name":"6.25 한국 전쟁","type":"national"},"2022-07-07 00:00:00":{"name":"소서","type":"solarterms"},"2022-07-16 00:00:00":{"name":"초복","type":"solarterms"},"2022-07-17 00:00:00":{"name":"제헌절","type":"national"},"2022-07-23 00:00:00":{"name":"대서","type":"solarterms"},"2022-07-26 00:00:00":{"name":"중복","type":"solarterms"},"2022-08-05 00:00:00":{"name":"말복","type":"solarterms"},"2022-08-07 00:00:00":{"name":"입추","type":"solarterms"},"2022-08-15 00:00:00":{"name":"광복절","type":"holiday"},"2022-08-23 00:00:00":{"name":"처서","type":"solarterms"},"2022-09-08 00:00:00":{"name":"백로","type":"solarterms"},"2022-09-09 00:00:00":{"name":"추석","type":"consecutive"},"2022-09-10 00:00:00":{"name":"추석","type":"holiday"},"2022-09-11 00:00:00":{"name":"추석","type":"consecutive"},"2022-09-23 00:00:00":{"name":"추분","type":"solarterms"},"2022-10-03 00:00:00":{"name":"개천절","type":"holiday"},"2022-10-08 00:00:00":{"name":"한로","type":"solarterms"},"2022-10-09 00:00:00":{"name":"한글날","type":"holiday"},"2022-10-23 00:00:00":{"name":"상강","type":"solarterms"},"2022-11-07 00:00:00":{"name":"입동","type":"solarterms"},"2022-11-22 00:00:00":{"name":"소설","type":"solarterms"},"2022-12-07 00:00:00":{"name":"대설","type":"solarterms"},"2022-12-21 00:00:00":{"name":"20대 대통령선거","type":"holiday"},"2022-12-22 00:00:00":{"name":"동지","type":"solarterms"},"2022-12-25 00:00:00":{"name":"성탄절","type":"holiday"},"2023-01-01 00:00:00":{"name":"새해 첫날","type":"holiday"},"2023-01-05 00:00:00":{"name":"소한","type":"solarterms"},"2023-01-20 00:00:00":{"name":"대한","type":"solarterms"},"2023-01-21 00:00:00":{"name":"설날","type":"consecutive"},"2023-01-22 00:00:00":{"name":"설날","type":"holiday"},"2023-01-23 00:00:00":{"name":"설날","type":"consecutive"},"2023-02-04 00:00:00":{"name":"입춘","type":"solarterms"},"2023-02-05 00:00:00":{"name":"정월 대보름","type":"solarterms"},"2023-02-14 00:00:00":{"name":"밸런타인데이","type":"etc"},"2023-02-19 00:00:00":{"name":"우수","type":"solarterms"},"2023-03-01 00:00:00":{"name":"삼일절","type":"holiday"},"2023-03-06 00:00:00":{"name":"경칩","type":"solarterms"},"2023-03-08 00:00:00":{"name":"조합장선거","type":"solarterms"},"2023-03-14 00:00:00":{"name":"화이트데이","type":"etc"},"2023-03-21 00:00:00":{"name":"춘분","type":"solarterms"},"2023-04-05 00:00:00":{"name":"청명","type":"solarterms"},"2023-04-06 00:00:00":{"name":"한식","type":"solarterms"},"2023-04-20 00:00:00":{"name":"곡우","type":"solarterms"},"2023-05-01 00:00:00":{"name":"근로자의날","type":"national"},"2023-05-05 00:00:00":{"name":"어린이날","type":"holiday"},"2023-05-06 00:00:00":{"name":"입하","type":"solarterms"},"2023-05-08 00:00:00":{"name":"어버이날","type":"national"},"2023-05-10 00:00:00":{"name":"유권자의날","type":"national"},"2023-05-15 00:00:00":{"name":"스승의날","type":"national"},"2023-05-21 00:00:00":{"name":"소만","type":"solarterms"},"2023-05-27 00:00:00":{"name":"석가탄신일","type":"holiday"},"2023-06-06 00:00:00":{"name":"망종","type":"solarterms"},"2023-06-22 00:00:00":{"name":"단오","type":"solarterms"},"2023-06-25 00:00:00":{"name":"6.25 한국 전쟁","type":"national"},"2023-07-07 00:00:00":{"name":"소서","type":"solarterms"},"2023-07-17 00:00:00":{"name":"제헌절","type":"national"},"2023-07-21 00:00:00":{"name":"초복","type":"solarterms"},"2023-07-23 00:00:00":{"name":"대서","type":"solarterms"},"2023-07-31 00:00:00":{"name":"중복","type":"solarterms"},"2023-08-08 00:00:00":{"name":"입추","type":"solarterms"},"2023-08-10 00:00:00":{"name":"말복","type":"solarterms"},"2023-08-15 00:00:00":{"name":"광복절","type":"holiday"},"2023-08-23 00:00:00":{"name":"처서","type":"solarterms"},"2023-09-08 00:00:00":{"name":"백로","type":"solarterms"},"2023-09-23 00:00:00":{"name":"추분","type":"solarterms"},"2023-09-28 00:00:00":{"name":"추석","type":"consecutive"},"2023-09-29 00:00:00":{"name":"추석","type":"holiday"},"2023-09-30 00:00:00":{"name":"추석","type":"consecutive"},"2023-10-03 00:00:00":{"name":"개천절","type":"holiday"},"2023-10-08 00:00:00":{"name":"한로","type":"solarterms"},"2023-10-09 00:00:00":{"name":"한글날","type":"holiday"},"2023-10-24 00:00:00":{"name":"상강","type":"solarterms"},"2023-11-08 00:00:00":{"name":"입동","type":"solarterms"},"2023-11-22 00:00:00":{"name":"소설","type":"solarterms"},"2023-12-07 00:00:00":{"name":"대설","type":"solarterms"},"2023-12-22 00:00:00":{"name":"동지","type":"solarterms"},"2023-12-25 00:00:00":{"name":"성탄절","type":"holiday"},"2024-01-01 00:00:00":{"name":"새해 첫날","type":"holiday"},"2024-01-06 00:00:00":{"name":"소한","type":"solarterms"},"2024-01-20 00:00:00":{"name":"대한","type":"solarterms"},"2024-02-04 00:00:00":{"name":"입춘","type":"solarterms"},"2024-02-09 00:00:00":{"name":"설날","type":"consecutive"},"2024-02-10 00:00:00":{"name":"설날","type":"holiday"},"2024-02-11 00:00:00":{"name":"설날","type":"consecutive"},"2024-02-14 00:00:00":{"name":"밸런타인데이","type":"etc"},"2024-02-19 00:00:00":{"name":"우수","type":"solarterms"},"2024-02-24 00:00:00":{"name":"정월 대보름","type":"solarterms"},"2024-03-01 00:00:00":{"name":"삼일절","type":"holiday"},"2024-03-05 00:00:00":{"name":"경칩","type":"solarterms"},"2024-03-14 00:00:00":{"name":"화이트데이","type":"etc"},"2024-03-20 00:00:00":{"name":"춘분","type":"solarterms"},"2024-04-04 00:00:00":{"name":"청명","type":"solarterms"},"2024-04-05 00:00:00":{"name":"한식","type":"solarterms"},"2024-04-10 00:00:00":{"name":"22대 국회의원선거","type":"holiday"},"2024-04-19 00:00:00":{"name":"곡우","type":"solarterms"},"2024-05-01 00:00:00":{"name":"근로자의날","type":"national"},"2024-05-05 00:00:00":{"name":"입하","type":"solarterms"},"2024-05-08 00:00:00":{"name":"어버이날","type":"national"},"2024-05-10 00:00:00":{"name":"유권자의날","type":"national"},"2024-05-15 00:00:00":{"name":"스승의날","type":"national"},"2024-05-20 00:00:00":{"name":"소만","type":"solarterms"},"2024-06-05 00:00:00":{"name":"망종","type":"solarterms"},"2024-06-06 00:00:00":{"name":"현충일","type":"holiday"},"2024-06-10 00:00:00":{"name":"단오","type":"solarterms"},"2024-06-21 00:00:00":{"name":"하지","type":"solarterms"},"2024-06-25 00:00:00":{"name":"6.25 한국 전쟁","type":"national"},"2024-07-06 00:00:00":{"name":"소서","type":"solarterms"},"2024-07-15 00:00:00":{"name":"초복","type":"solarterms"},"2024-07-17 00:00:00":{"name":"제헌절","type":"national"},"2024-07-22 00:00:00":{"name":"대서","type":"solarterms"},"2024-07-25 00:00:00":{"name":"중복","type":"solarterms"},"2024-08-04 00:00:00":{"name":"말복","type":"solarterms"},"2024-08-07 00:00:00":{"name":"입추","type":"solarterms"},"2024-08-15 00:00:00":{"name":"광복절","type":"holiday"},"2024-08-23 00:00:00":{"name":"처서","type":"solarterms"},"2024-09-07 00:00:00":{"name":"백로","type":"solarterms"},"2024-09-16 00:00:00":{"name":"추석","type":"consecutive"},"2024-09-17 00:00:00":{"name":"추석","type":"holiday"},"2024-09-18 00:00:00":{"name":"추석","type":"consecutive"},"2024-09-22 00:00:00":{"name":"추분","type":"solarterms"},"2024-10-03 00:00:00":{"name":"개천절","type":"holiday"},"2024-10-08 00:00:00":{"name":"한로","type":"solarterms"},"2024-10-09 00:00:00":{"name":"한글날","type":"holiday"},"2024-10-23 00:00:00":{"name":"상강","type":"solarterms"},"2024-11-07 00:00:00":{"name":"입동","type":"solarterms"},"2024-11-22 00:00:00":{"name":"소설","type":"solarterms"},"2024-12-07 00:00:00":{"name":"대설","type":"solarterms"},"2024-12-21 00:00:00":{"name":"동지","type":"solarterms"},"2024-12-25 00:00:00":{"name":"성탄절","type":"holiday"},"2025-01-01 00:00:00":{"name":"새해 첫날","type":"holiday"},"2025-01-05 00:00:00":{"name":"소한","type":"solarterms"},"2025-01-20 00:00:00":{"name":"대한","type":"solarterms"},"2025-01-28 00:00:00":{"name":"설날","type":"consecutive"},"2025-01-29 00:00:00":{"name":"설날","type":"holiday"},"2025-01-30 00:00:00":{"name":"설날","type":"consecutive"},"2025-02-03 00:00:00":{"name":"입춘","type":"solarterms"},"2025-02-12 00:00:00":{"name":"정월 대보름","type":"solarterms"},"2025-02-14 00:00:00":{"name":"밸런타인데이","type":"etc"},"2025-02-18 00:00:00":{"name":"우수","type":"solarterms"},"2025-03-01 00:00:00":{"name":"삼일절","type":"holiday"},"2025-03-05 00:00:00":{"name":"경칩","type":"solarterms"},"2025-03-14 00:00:00":{"name":"화이트데이","type":"etc"},"2025-03-20 00:00:00":{"name":"춘분","type":"solarterms"},"2025-04-04 00:00:00":{"name":"청명","type":"solarterms"},"2025-04-05 00:00:00":{"name":"한식","type":"solarterms"},"2025-04-20 00:00:00":{"name":"곡우","type":"solarterms"},"2025-05-01 00:00:00":{"name":"근로자의날","type":"national"},"2025-05-05 00:00:00":{"name":"입하","type":"solarterms"},"2025-05-08 00:00:00":{"name":"어버이날","type":"national"},"2025-05-10 00:00:00":{"name":"유권자의날","type":"national"},"2025-05-15 00:00:00":{"name":"스승의날","type":"national"},"2025-05-21 00:00:00":{"name":"소만","type":"solarterms"},"2025-05-31 00:00:00":{"name":"단오","type":"solarterms"},"2025-06-05 00:00:00":{"name":"망종","type":"solarterms"},"2025-06-06 00:00:00":{"name":"현충일","type":"holiday"},"2025-06-21 00:00:00":{"name":"하지","type":"solarterms"},"2025-06-25 00:00:00":{"name":"6.25 한국 전쟁","type":"national"},"2025-07-07 00:00:00":{"name":"소서","type":"solarterms"},"2025-07-17 00:00:00":{"name":"제헌절","type":"national"},"2025-07-20 00:00:00":{"name":"초복","type":"solarterms"},"2025-07-22 00:00:00":{"name":"대서","type":"solarterms"},"2025-07-30 00:00:00":{"name":"중복","type":"solarterms"},"2025-08-07 00:00:00":{"name":"입추","type":"solarterms"},"2025-08-09 00:00:00":{"name":"말복","type":"solarterms"},"2025-08-15 00:00:00":{"name":"광복절","type":"holiday"},"2025-08-23 00:00:00":{"name":"처서","type":"solarterms"},"2025-09-07 00:00:00":{"name":"백로","type":"solarterms"},"2025-09-23 00:00:00":{"name":"추분","type":"solarterms"},"2025-10-03 00:00:00":{"name":"개천절","type":"holiday"},"2025-10-05 00:00:00":{"name":"추석","type":"consecutive"},"2025-10-06 00:00:00":{"name":"추석","type":"holiday"},"2025-10-07 00:00:00":{"name":"추석","type":"consecutive"},"2025-10-08 00:00:00":{"name":"한로","type":"solarterms"},"2025-10-09 00:00:00":{"name":"한글날","type":"holiday"},"2025-10-23 00:00:00":{"name":"상강","type":"solarterms"},"2025-11-07 00:00:00":{"name":"입동","type":"solarterms"},"2025-11-22 00:00:00":{"name":"소설","type":"solarterms"},"2025-12-07 00:00:00":{"name":"대설","type":"solarterms"},"2025-12-21 00:00:00":{"name":"동지","type":"solarterms"},"2025-12-25 00:00:00":{"name":"성탄절","type":"holiday"},"2026-01-01 00:00:00":{"name":"새해 첫날","type":"holiday"},"2026-01-05 00:00:00":{"name":"소한","type":"solarterms"},"2026-01-20 00:00:00":{"name":"대한","type":"solarterms"},"2026-02-04 00:00:00":{"name":"입춘","type":"solarterms"},"2026-02-14 00:00:00":{"name":"밸런타인데이","type":"etc"},"2026-02-16 00:00:00":{"name":"설날","type":"consecutive"},"2026-02-17 00:00:00":{"name":"설날","type":"holiday"},"2026-02-18 00:00:00":{"name":"설날","type":"consecutive"},"2026-02-19 00:00:00":{"name":"우수","type":"solarterms"},"2026-03-01 00:00:00":{"name":"삼일절","type":"holiday"}} 9 | 10 | load: (mindate, maxdate, url) -> 11 | if loadHolidaySuccess then return 12 | 13 | if url # specify a custom url 14 | $http( 15 | method: 'GET' 16 | url: url 17 | params: { 18 | startDate: $filter('date') mindate, 'yyyy-MM-dd' 19 | endDate: $filter('date') maxdate, 'yyyy-MM-dd' 20 | } 21 | ).then (o) -> 22 | loadHolidaySuccess = true 23 | holidays = o.data 24 | 25 | isHoliday: (date) -> 26 | if date and holidays 27 | dateString = $filter('date') date, 'yyyy-MM-dd 00:00:00' 28 | if holidays[dateString] and (holidays[dateString].type == 'holiday' or holidays[dateString].type == 'consecutive') 29 | return true 30 | false 31 | getToday: () -> 32 | return todayDate 33 | setToday: (d) -> 34 | todayDate = d 35 | setHoliday: (h) -> 36 | holidays = h 37 | loadHolidaySuccess = true 38 | ] 39 | -------------------------------------------------------------------------------- /src/mg-datepicker.directive.coffee: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | app = angular.module 'datePeriodPicker' 4 | 5 | app.directive 'mgDatepicker', ['$timeout', '$filter', ($timeout, $filter) -> 6 | restrict: 'AE' 7 | replace: true 8 | scope: 9 | mgOptions: '=' 10 | mgStart: '=' 11 | mgEnd: '=' 12 | mgButtonName: '=' 13 | mgCallback: '=' 14 | mgSelect: '&' 15 | 16 | templateUrl: (tElement, tAttrs) -> 17 | return "release/mg-datepicker.html" 18 | 19 | link: (scope, element, attrs) -> 20 | if scope.mgOptions.project == 'flights' 21 | id = null 22 | monthElement = null 23 | monthDate = null 24 | if scope.mgOptions.openButton == 'sdate0' 25 | monthDate = scope.mgOptions.sdate0 26 | else if scope.mgOptions.openButton == 'sdate1' 27 | monthDate = scope.mgOptions.sdate1 28 | else if scope.mgOptions.openButton == 'sdate2' 29 | monthDate = scope.mgOptions.sdate2 30 | if monthDate != null 31 | id = $filter('date')(monthDate, 'yyyy.MM') 32 | monthElement = angular.element(document.getElementById(id)) 33 | element.parent()[0].scrollTop = monthElement[0].offsetTop 34 | return 35 | if !scope.mgStart? then return 36 | $timeout () -> # Scrolling to selected dates 37 | id = $filter('date')(scope.mgStart, 'yyyy.MM') 38 | monthElement = angular.element document.getElementById(id) 39 | element.parent()[0].scrollTop = monthElement[0].offsetTop 40 | 41 | controller: ['$scope', 'ModalService', 'Calendar', '$compile', (scope, ModalService, Calendar, compile) -> 42 | # set default value 43 | if not scope.mgOptions.checkInString 44 | scope.mgOptions.checkInString = 'check in' 45 | if !scope.mgOptions.checkOutString 46 | scope.mgOptions.checkOutString = 'check out' 47 | 48 | scope.weekdays = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'] 49 | startSelected = false 50 | # init pension options 51 | if scope.mgOptions.mgPenTodaysDeal or (scope.mgStart and scope.mgButtonName is 'checkout') 52 | startSelected = true 53 | 54 | # Get date restictions 55 | scope.restrictions = 56 | mindate: new Date() 57 | maxdate: new Date() 58 | if scope.mgOptions?.selectableDays? 59 | # if selectableDays is 1, then only today is selectable -> selectableDays-1 60 | nEnabledTimeLength = (1000 * 60 * 60 * 24) * (scope.mgOptions.selectableDays-1) 61 | scope.restrictions.maxdate.setTime(scope.restrictions.maxdate.getTime() + nEnabledTimeLength) 62 | else 63 | scope.restrictions.maxdate.setMonth scope.restrictions.mindate.getMonth() + 12 64 | 65 | if scope.mgOptions?.mindate? 66 | scope.restrictions.mindate = new Date scope.mgOptions.mindate 67 | if scope.mgOptions?.maxdate? 68 | scope.restrictions.maxdate = new Date scope.mgOptions.maxdate 69 | else 70 | scope.restrictions.mindate.setHours 0, 0, 0, 0 71 | scope.restrictions.maxdate.setHours 23, 59, 59, 999 72 | 73 | # Make an array of months to be displayed date restictions 74 | # Show months that have at least one enabled day 75 | months = [] 76 | date = new Date scope.restrictions.mindate.getTime() 77 | date.setHours 0, 0, 0, 0 78 | date.setDate 1 79 | 80 | while date <= scope.restrictions.maxdate 81 | months.push new Date date.getTime() 82 | date.setMonth date.getMonth() + 1 83 | 84 | weeksInMonth = (month) -> 85 | weeks = [] 86 | day = new Date month 87 | while day.getMonth() is month.getMonth() 88 | newDay = new Date day 89 | if !week 90 | week = [] 91 | # push null for empty days 92 | for each in [1..day.getDay()] by 1 93 | week.push null 94 | # end of week or end of month 95 | if day.getDay() is 6 or (new Date day.getYear(), day.getMonth()+1, 0).getDate()==day.getDate() 96 | week.push newDay 97 | 98 | weeks.push week 99 | week = [] 100 | else 101 | week.push newDay 102 | 103 | day.setDate day.getDate()+1 104 | weeks 105 | 106 | activate = -> 107 | scope.dates = [] 108 | arrayMonths = []; 109 | for monthStart in months 110 | arrayMonths.push {monthText:$filter('date')(monthStart, 'yyyy.MM'), weeks:weeksInMonth(monthStart)} 111 | drawCalendar(arrayMonths); 112 | 113 | drawCalendar = (arrayMonths) -> 114 | calendarHtml = '' 115 | for month in arrayMonths 116 | calendarHtml += getMonthHtml month 117 | elCustom = document.getElementById 'custom-modal' 118 | elCon = elCustom.querySelector '.datepicker' 119 | welCon = angular.element elCon 120 | elCompile = compile(calendarHtml)(scope) 121 | welCon.html '' 122 | welCon.append elCompile 123 | 124 | getMonthHtml = (obj) -> 125 | weeks = obj.weeks 126 | monthText = obj.monthText 127 | str = '' 128 | str += '
' 129 | str += '
' + monthText + '
' 130 | str += '' 131 | str += '' 132 | str += '' 133 | for week in weeks 134 | dateArr = week 135 | str += '' 136 | for dateObj in dateArr 137 | if dateObj == null 138 | str += '' 139 | else 140 | numClass = scope.calendar.class(dateObj) 141 | str += '' 170 | str += ''; 171 | str += '
SUNMONTUEWEDTHUFRISAT
' 142 | str += '
' 143 | str += '
' + dateObj.getDate() + '
' 144 | if scope.mgOptions.project == 'flights' # flights 145 | addStr = '' 146 | if scope.mgOptions.trip == 'rt' && scope.calendar.isRoundTripSameDate(dateObj) # 왕복일때 가는날,오는날 같다 147 | addStr = '
당일
' 148 | else 149 | if numClass.indexOf('today') != -1 150 | addStr = '
오늘
' 151 | else 152 | if scope.calendar.isSdate0(dateObj) 153 | addStr += '
' + scope.mgOptions.sdate0String + '
' 154 | if scope.calendar.isSdate1(dateObj) 155 | addStr += '
' + scope.mgOptions.sdate1String + '
' 156 | if scope.calendar.isSdate2(dateObj) 157 | addStr += '
' + scope.mgOptions.sdate2String + '
' 158 | str += addStr 159 | else 160 | # 오늘 161 | if numClass.indexOf('today') != -1 162 | str += '
오늘
' 163 | # 체크인 164 | if scope.calendar.isStart(dateObj) 165 | str += '
' + scope.mgOptions.checkInString + '
' 166 | # 체크아웃 167 | if scope.calendar.isEnd(dateObj) 168 | str += '
' + scope.mgOptions.checkOutString + '
' 169 | str += '
'; 172 | str 173 | 174 | drawCheckInCheckOut = -> 175 | if scope.mgOptions.limitNights != null # limitNights 가 설정되어 있으면 전체 다시 그리기로 한다. 176 | activate() 177 | return 178 | 179 | if scope.mgStart != null 180 | drawStartDate scope.mgStart, scope.mgStart.getFullYear(), scope.mgStart.getMonth() + 1, scope.mgStart.getDate() 181 | if scope.mgEnd != null 182 | drawEndDate scope.mgEnd, scope.mgEnd.getFullYear(), scope.mgEnd.getMonth() + 1, scope.mgEnd.getDate() 183 | if scope.mgStart != null and scope.mgEnd != null 184 | beDate = new Date(scope.mgStart.getFullYear(), scope.mgStart.getMonth(), scope.mgStart.getDate()) 185 | beDate.setDate beDate.getDate() + 1 186 | while beDate < scope.mgEnd 187 | elTd = document.getElementById($filter('date')(beDate, 'yyyyMd')) 188 | angular.element(elTd).addClass 'between-selected' 189 | beDate.setDate beDate.getDate() + 1 190 | return 191 | 192 | drawStartDate = (date, nYear, nMonth, nDate) -> 193 | td = document.getElementById nYear + '' + nMonth + '' + nDate 194 | angular.element(td).addClass 'selected' 195 | cell = td.querySelector '.cell' 196 | angular.element(cell).append '
' + scope.mgOptions.checkInString + '
' 197 | 198 | elCustom = document.getElementById 'custom-modal' 199 | if scope.calendar.isToday(date) # 만약 오늘을 클릭한거라면 200 | # 글자 제거 201 | elTodayStr = elCustom.querySelector '.txtToday' 202 | if typeof elTodayStr != 'undefined' 203 | angular.element(elTodayStr).remove() 204 | # 클래스 제거 205 | elToday = elCustom.querySelector '.today' 206 | if typeof elToday != 'undefined' 207 | angular.element(elToday).removeClass 'today' 208 | else # 오늘을 클릭한게 아니면 209 | todayId = $filter('date')(Calendar.getToday(), 'yyyyMd') 210 | td = document.getElementById todayId 211 | if td.querySelector('.txtToday') == null 212 | # 오늘 표시가 없으면 넣는다 213 | angular.element(td).addClass 'today' 214 | angular.element(td.querySelector('.cell')).append '
오늘
' 215 | 216 | drawEndDate = (date, nYear, nMonth, nDate) -> 217 | td = document.getElementById nYear + '' + nMonth + '' + nDate 218 | angular.element(td).addClass 'selected' 219 | cell = td.querySelector '.cell' 220 | angular.element(cell).append '
' + scope.mgOptions.checkOutString + '
' 221 | 222 | removeCheckOut = -> 223 | elCustom = document.getElementById 'custom-modal' 224 | # 체크아웃 글자 remove 225 | elCheckOut = elCustom.querySelector '.txtCheckOut' 226 | if typeof elCheckOut != 'undefined' 227 | angular.element(elCheckOut).remove() 228 | # selected removeClass 229 | arrSelect = elCustom.querySelectorAll '.selected' 230 | if 0 < arrSelect.length 231 | checkoutSelected = arrSelect[arrSelect.length - 1] 232 | angular.element(checkoutSelected).removeClass 'selected' 233 | # between-selected removeClass 234 | arrBetween = elCustom.querySelectorAll '.between-selected' 235 | for elBetween in arrBetween 236 | angular.element(elBetween).removeClass 'between-selected' 237 | 238 | removeCheckInOut = () -> 239 | elCustom = document.getElementById 'custom-modal' 240 | # 체크인 글자 remove 241 | elCheckIn = elCustom.querySelector '.txtCheckIn' 242 | if typeof elCheckIn != 'undefined' 243 | angular.element(elCheckIn).remove() 244 | # 체크아웃 글자 remove 245 | elCheckOut = elCustom.querySelector '.txtCheckOut' 246 | if typeof elCheckOut != 'undefined' 247 | angular.element(elCheckOut).remove() 248 | # selected removeClass 249 | arrSelect = elCustom.querySelectorAll '.selected' 250 | for elSelect in arrSelect 251 | angular.element(elSelect).removeClass 'selected' 252 | # between-selected removeClass 253 | arrBetween = elCustom.querySelectorAll '.between-selected' 254 | for elBetween in arrBetween 255 | angular.element(elBetween).removeClass 'between-selected' 256 | 257 | # flights 258 | drawSelectedFlight = () -> 259 | options = scope.mgOptions 260 | elCalendar = document.getElementById('custom-modal') 261 | today = new Date(Calendar.getToday().getTime()).setHours(0, 0, 0, 0) # today 262 | # 1471446000... 263 | if options.sdate0 != null and options.sdate0.getTime() == today or options.sdate1 != null and options.sdate1.getTime() == today or options.sdate2 != null and options.sdate2.getTime() == today 264 | angular.element(elCalendar.querySelector('.today')).removeClass 'today' 265 | angular.element(elCalendar.querySelector('.txtToday')).remove() 266 | # 당일 삭제 267 | sameDate = elCalendar.querySelector('.txtSame') 268 | if sameDate != null 269 | angular.element(sameDate).remove() 270 | # 가는날, 오는날, 여정1, 여정2, 여정3 삭제 271 | elSdate0 = elCalendar.querySelector('.txtSdate0') 272 | if elSdate0 != null 273 | angular.element(elSdate0).remove() 274 | elSdate1 = elCalendar.querySelector('.txtSdate1') 275 | if elSdate1 != null 276 | angular.element(elSdate1).remove() 277 | elSdate2 = elCalendar.querySelector('.txtSdate2') 278 | if elSdate2 != null 279 | angular.element(elSdate2).remove() 280 | # selected 삭제 281 | selectedArr = elCalendar.querySelectorAll('.selected') 282 | i = 0 283 | while i < selectedArr.length 284 | angular.element(selectedArr[i]).removeClass 'selected' 285 | i++ 286 | # between-selected 삭제 287 | betweenArr = elCalendar.querySelectorAll('.between-selected') 288 | i = 0 289 | while i < betweenArr.length 290 | angular.element(betweenArr[i]).removeClass 'between-selected' 291 | i++ 292 | # 당일 표시(왕복 && 가는날, 오는날이 같을때) 293 | if options.trip == 'rt' and options.sdate0 != null and options.sdate1 != null and options.sdate0.getTime() == options.sdate1.getTime() 294 | td = document.getElementById($filter('date')(options.sdate0, 'yyyyMd')) 295 | angular.element(td).addClass 'selected' 296 | cell = td.querySelector('.cell') 297 | angular.element(cell).append '
당일
' 298 | # 당일 아닐때 299 | else 300 | # 여정1 표시 301 | if options.sdate0 != null 302 | td = document.getElementById($filter('date')(options.sdate0, 'yyyyMd')) 303 | angular.element(td).addClass 'selected' 304 | cell = td.querySelector('.cell') 305 | angular.element(cell).append '
' + scope.mgOptions.sdate0String + '
' 306 | # 여정2 표시 307 | if options.sdate1 != null 308 | td = document.getElementById($filter('date')(options.sdate1, 'yyyyMd')) 309 | angular.element(td).addClass 'selected' 310 | cell = td.querySelector('.cell') 311 | angular.element(cell).append '
' + scope.mgOptions.sdate1String + '
' 312 | # 여정3 표시 313 | if options.sdate2 != null 314 | td = document.getElementById($filter('date')(options.sdate2, 'yyyyMd')) 315 | angular.element(td).addClass 'selected' 316 | cell = td.querySelector('.cell') 317 | angular.element(cell).append '
' + scope.mgOptions.sdate2String + '
' 318 | # between-selected 표시 (sdate0 ~ sdate1) 319 | if options.sdate0 != null and options.sdate1 != null and options.sdate0.getTime() != options.sdate1.getTime() 320 | betweenDate = new Date(options.sdate0.getTime()) 321 | betweenDate.setDate betweenDate.getDate() + 1 322 | while betweenDate.getTime() < options.sdate1.getTime() 323 | td = document.getElementById($filter('date')(betweenDate, 'yyyyMd')) 324 | angular.element(td).addClass 'between-selected' 325 | betweenDate.setDate betweenDate.getDate() + 1 326 | # between-selected 표시 (sdate1 ~ sdate2) 327 | if options.sdate1 != null and options.sdate2 != null and options.sdate1.getTime() != options.sdate2.getTime() 328 | betweenDate = new Date(options.sdate1.getTime()) 329 | betweenDate.setDate betweenDate.getDate() + 1 330 | while betweenDate.getTime() < options.sdate2.getTime() 331 | td = document.getElementById($filter('date')(betweenDate, 'yyyyMd')) 332 | angular.element(td).addClass 'between-selected' 333 | betweenDate.setDate betweenDate.getDate() + 1 334 | # between-selected 표시 (sdate0 ~ sdate2) 335 | if options.sdate0 != null and options.sdate1 == null and options.sdate2 != null and options.sdate0.getTime() != options.sdate2.getTime() 336 | betweenDate = new Date(options.sdate0.getTime()) 337 | betweenDate.setDate betweenDate.getDate() + 1 338 | while betweenDate.getTime() < options.sdate2.getTime() 339 | td = document.getElementById($filter('date')(betweenDate, 'yyyyMd')) 340 | angular.element(td).addClass 'between-selected' 341 | betweenDate.setDate betweenDate.getDate() + 1 342 | return 343 | 344 | # 공휴일 로드 345 | if scope.mgOptions.enableKoreanCalendar 346 | Calendar.load scope.restrictions.mindate, scope.restrictions.maxdate, scope.mgOptions.holidayUrl 347 | 348 | scope.calendar = 349 | offsetMargin: (date) -> 350 | new Date(date.getFullYear(), date.getMonth()).getDay() * 2.75 + 'rem' 351 | isVisible: (date, day) -> 352 | new Date(date.getFullYear(), date.getMonth(), day).getMonth() is date.getMonth() 353 | isDisabled: (currentDate) -> 354 | mindate = scope.restrictions.mindate 355 | if scope.mgOptions.limitNights? and startSelected 356 | maxdate = new Date scope.mgStart.getFullYear(), scope.mgStart.getMonth(), scope.mgStart.getDate() + scope.mgOptions.limitNights 357 | if maxdate > scope.restrictions.maxdate then maxdate = scope.restrictions.maxdate 358 | else 359 | maxdate = scope.restrictions.maxdate 360 | (mindate? and currentDate < mindate) or (maxdate? and currentDate > maxdate) 361 | isToday: (day) -> 362 | day.toDateString() == Calendar.getToday().toDateString() 363 | isStart: (day) -> 364 | scope.mgStart? and scope.mgStart.getTime() is day.getTime() 365 | isEnd: (day) -> 366 | scope.mgEnd? and scope.mgEnd.getTime() is day.getTime() 367 | isSdate0: (day) -> # flights 368 | scope.mgOptions.sdate0 != null && scope.mgOptions.sdate0.getTime() == day.getTime() 369 | isSdate1: (day) -> # flights 370 | scope.mgOptions.sdate1 != null && scope.mgOptions.sdate1.getTime() == day.getTime() 371 | isSdate2: (day) -> # flights 372 | scope.mgOptions.sdate2 != null && scope.mgOptions.sdate2.getTime() == day.getTime() 373 | isRoundTripSameDate: (day) -> # flights 374 | if scope.mgOptions.sdate0 != null && scope.mgOptions.sdate1 != null 375 | return scope.mgOptions.sdate0.getTime() == day.getTime() && scope.mgOptions.sdate1.getTime() == day.getTime() 376 | class: (day) -> 377 | classString = '' 378 | dayObj = new Date day 379 | if this.isDisabled dayObj 380 | classString = 'disabled' 381 | else if scope.mgOptions.enableKoreanCalendar and Calendar.isHoliday dayObj 382 | classString = 'holiday' 383 | else 384 | if dayObj.getDay() is 0 385 | classString = 'sunday' 386 | else if dayObj.getDay() is 6 387 | classString = 'saturday' 388 | # flights 389 | if scope.mgOptions.project == 'flights' 390 | options = scope.mgOptions 391 | if options.sdate0 != null && options.sdate0.getTime() == dayObj.getTime() 392 | classString += ' selected' 393 | else if options.sdate1 != null && options.sdate1.getTime() == dayObj.getTime() 394 | classString += ' selected' 395 | else if options.sdate2 != null && options.sdate2.getTime() == dayObj.getTime() 396 | classString += ' selected' 397 | else if options.sdate0 != null && options.sdate1 != null && dayObj > options.sdate0 && dayObj < options.sdate1 # sdate0 ~ sdate1 398 | classString = 'between-selected' 399 | else if options.sdate1 != null && options.sdate2 != null && dayObj > options.sdate1 && dayObj < options.sdate2 # sdate1 ~ sdate2 400 | classString = 'between-selected' 401 | else if dayObj.getTime() == new Date().setHours(0, 0, 0, 0) 402 | classString = 'today' 403 | else 404 | if scope.mgStart? and scope.mgStart.getTime() is dayObj.getTime() 405 | classString += ' selected' 406 | else if scope.mgEnd? and scope.mgEnd.getTime() is dayObj.getTime() 407 | classString += ' selected' 408 | else if scope.mgStart? and scope.mgEnd? and dayObj > scope.mgStart and dayObj < scope.mgEnd 409 | classString = 'between-selected' 410 | else if scope.mgOptions.today? 411 | if dayObj.getTime() is scope.mgOptions.today.setHours(0, 0, 0, 0) 412 | classString = 'today' 413 | else if dayObj.getTime() is new Date().setHours(0, 0, 0, 0) 414 | classString = 'today' 415 | classString 416 | startDayText: -> 417 | if scope.mgOptions.startDateText 418 | scope.startDateText 419 | endDayText: -> 420 | if scope.mgOptions.endDateText 421 | scope.endDateText 422 | 423 | select: (isDisabled, nYear, nMonth, nDate) -> 424 | date = new Date nYear, nMonth-1, nDate 425 | if isDisabled == 'disabled' # 비활성이면 return 426 | return 427 | 428 | # flights 429 | if typeof scope.mgOptions.project != 'undefined' && scope.mgOptions.project == 'flights' 430 | today = new Date(Calendar.getToday().getTime()).setHours(0, 0, 0, 0) # 1471446000... 431 | if scope.mgOptions.isDomestic == 0 && today == date.getTime() # 해외이고 오늘 날짜 선택이면 return 432 | return 433 | 434 | options = scope.mgOptions 435 | # 편도 436 | if options.trip == 'ow' 437 | scope.mgCallback 438 | trip: 'ow' 439 | where: 'sdate0' 440 | options.sdate0 = date 441 | drawSelectedFlight() 442 | $timeout (-> 443 | scope.mgSelect() 444 | ), 300 445 | # 왕복 446 | else if options.trip == 'rt' 447 | scope.mgCallback 448 | trip: 'rt' 449 | where: options.openButton 450 | if options.openButton == 'sdate0' 451 | if options.sdate1 != null and options.sdate1.getTime() < date.getTime() 452 | options.sdate1 = null 453 | options.sdate0 = date 454 | else 455 | options.sdate0 = date 456 | else if scope.mgOptions.openButton == 'sdate1' 457 | if options.sdate0 != null and options.sdate0.getTime() > date.getTime() 458 | options.sdate0 = date 459 | options.sdate1 = null 460 | else 461 | options.sdate1 = date 462 | 463 | if options.sdate1 == null 464 | options.openButton = 'sdate1' 465 | else 466 | options.openButton = 'sdate0' 467 | drawSelectedFlight() 468 | # 모두 선택했으면 나간다 469 | if options.sdate0 != null and options.sdate1 != null 470 | $timeout (-> 471 | scope.mgSelect() 472 | ), 300 473 | # 다구간 474 | else if options.trip == 'md' 475 | scope.mgCallback 476 | trip: 'md' 477 | where: options.openButton 478 | if options.openButton == 'sdate0' 479 | options.sdate0 = new Date(date.getTime()) 480 | if options.sdate1 != null and options.sdate1.getTime() < date.getTime() # sdate1 < 481 | options.sdate1 = null 482 | if options.sdate2 != null and options.sdate2.getTime() < date.getTime() # sdate2 < 483 | options.sdate1 = null 484 | options.sdate2 = null 485 | else if options.openButton == 'sdate1' 486 | options.sdate1 = new Date(date.getTime()) 487 | if options.sdate0 != null and options.sdate0.getTime() > date.getTime() # sdate0 > 488 | options.sdate1 = null 489 | options.sdate0 = new Date(date.getTime()) 490 | if options.sdate2 != null and options.sdate2.getTime() < date.getTime() # sdate2 < 491 | options.sdate2 = null 492 | else if options.openButton == 'sdate2' 493 | options.sdate2 = new Date(date.getTime()) 494 | if options.sdate1 != null and options.sdate1.getTime() > date.getTime() # sdate1 > 495 | if options.sdate0 != null and options.sdate0.getTime() > date.getTime() # sdate0 > 496 | options.sdate2 = null 497 | options.sdate1 = null 498 | options.sdate0 = new Date(date.getTime()) 499 | else 500 | options.sdate2 = null 501 | options.sdate1 = new Date(date.getTime()) 502 | 503 | if options.sdate0 == null 504 | options.openButton = 'sdate0' 505 | else if options.sdate1 == null 506 | options.openButton = 'sdate1' 507 | else if options.sdate2 == null && options.isShowWay3 == true 508 | options.openButton = 'sdate2' 509 | 510 | drawSelectedFlight() 511 | # 모두 선택했으면 나간다 512 | if options.isShowWay3 == true and options.sdate0 != null and options.sdate1 != null and options.sdate2 != null 513 | $timeout (-> 514 | scope.mgSelect() 515 | ), 300 516 | else if options.isShowWay3 == false and options.sdate0 != null and options.sdate1 != null 517 | $timeout (-> 518 | scope.mgSelect() 519 | ), 300 520 | return # flights end 521 | 522 | # distinguish between tapping a start button and an end button 523 | if scope.mgButtonName is 'checkout' and scope.mgStart and scope.mgEnd 524 | if date <= scope.mgStart #체크인 이전을 클릭시엔 체크인을 선택 525 | scope.mgStart = date 526 | scope.mgEnd = null 527 | startSelected = true 528 | removeCheckInOut() 529 | drawCheckInCheckOut() 530 | if scope.mgCallback 531 | scope.mgCallback('start') 532 | return 533 | 534 | scope.mgEnd = date 535 | startSelected = false 536 | removeCheckInOut() 537 | drawCheckInCheckOut() 538 | if scope.mgCallback 539 | scope.mgCallback('end') 540 | $timeout (-> 541 | scope.mgSelect() 542 | ), 300 543 | else 544 | # [pension] today's deal only 545 | # startDate is fixed and only end date will be changed 546 | if scope.mgOptions.mgPenTodaysDeal 547 | scope.mgEnd = date 548 | removeCheckOut() 549 | drawCheckInCheckOut() 550 | if scope.mgCallback 551 | scope.mgCallback('end') 552 | $timeout (-> 553 | scope.mgSelect() 554 | ), 300 555 | else # general case 556 | scope.mgEnd = null # 호텔 달력 UX 변경. 체크인 선택후 체크아웃은 null로. 557 | startLimit = new Date scope.mgEnd 558 | startLimit.setDate startLimit.getDate() - scope.mgOptions.limitNights 559 | if !startSelected or (startSelected and date <= scope.mgStart) 560 | if !scope.mgButtonName or !scope.mgEnd or scope.mgEnd <= date or date < startLimit 561 | if scope.mgButtonName == 'checkin' && scope.mgStart != null && scope.mgEnd != null && date < scope.mgEnd 562 | diffDate = (scope.mgEnd.getTime() - date.getTime()) / (1000 * 60 * 60 * 24) # 숙박 기간 563 | if scope.mgOptions.limitNights && diffDate > scope.mgOptions.limitNights # 숙박 기간이 limitNights 보다 크면 체크인 설정 564 | scope.mgStart = date 565 | scope.mgEnd = null 566 | startSelected = true 567 | removeCheckInOut() 568 | drawCheckInCheckOut() 569 | if scope.mgCallback 570 | return scope.mgCallback('start') 571 | 572 | scope.mgStart = date 573 | startSelected = true 574 | removeCheckInOut() 575 | drawCheckInCheckOut() 576 | if scope.mgCallback 577 | scope.mgCallback('start') 578 | return $timeout (-> 579 | scope.mgSelect() 580 | ), 300 581 | 582 | scope.mgStart = date 583 | scope.mgEnd = null 584 | startSelected = true 585 | removeCheckInOut() 586 | drawCheckInCheckOut() 587 | if scope.mgCallback 588 | scope.mgCallback('start') 589 | 590 | else # 체크인/체크아웃 모두 있고, 체크인 버튼을 눌러서 들어오고, 체크아웃 이전으로 선택하면 실행 591 | scope.mgStart = date 592 | removeCheckInOut() 593 | drawCheckInCheckOut() 594 | if scope.mgCallback 595 | scope.mgCallback('start') 596 | 597 | $timeout (-> 598 | scope.mgSelect() 599 | ), 300 600 | 601 | else 602 | scope.mgEnd = date 603 | startSelected = false 604 | removeCheckInOut() 605 | drawCheckInCheckOut() 606 | if scope.mgCallback 607 | scope.mgCallback('end') 608 | $timeout (-> 609 | scope.mgSelect() 610 | ), 300 611 | 612 | activate() 613 | ] 614 | ] 615 | -------------------------------------------------------------------------------- /release/date-period-picker.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | angular.module('datePeriodPicker', []); 4 | 5 | }).call(this); 6 | 7 | (function() { 8 | 'use strict'; 9 | var app; 10 | 11 | app = angular.module('datePeriodPicker'); 12 | 13 | app.service('Calendar', [ 14 | '$http', '$filter', function($http, $filter) { 15 | var holidays, loadHolidaySuccess, todayDate; 16 | todayDate = new Date(); 17 | loadHolidaySuccess = false; 18 | holidays = { 19 | "2016-03-01 00:00:00": { 20 | "name": "삼일절", 21 | "type": "holiday" 22 | }, 23 | "2016-03-05 00:00:00": { 24 | "name": "경칩", 25 | "type": "solarterms" 26 | }, 27 | "2016-03-14 00:00:00": { 28 | "name": "화이트데이", 29 | "type": "etc" 30 | }, 31 | "2016-03-20 00:00:00": { 32 | "name": "춘분", 33 | "type": "solarterms" 34 | }, 35 | "2016-04-04 00:00:00": { 36 | "name": "청명", 37 | "type": "solarterms" 38 | }, 39 | "2016-04-05 00:00:00": { 40 | "name": "한식", 41 | "type": "solarterms" 42 | }, 43 | "2016-04-13 00:00:00": { 44 | "name": "20대 국회의원선거", 45 | "type": "holiday" 46 | }, 47 | "2016-04-20 00:00:00": { 48 | "name": "곡우", 49 | "type": "solarterms" 50 | }, 51 | "2016-05-01 00:00:00": { 52 | "name": "근로자의날", 53 | "type": "national" 54 | }, 55 | "2016-05-05 00:00:00": { 56 | "name": "입하", 57 | "type": "solarterms" 58 | }, 59 | "2016-05-08 00:00:00": { 60 | "name": "어버이날", 61 | "type": "national" 62 | }, 63 | "2016-05-10 00:00:00": { 64 | "name": "유권자의날", 65 | "type": "national" 66 | }, 67 | "2016-05-14 00:00:00": { 68 | "name": "석가탄신일", 69 | "type": "holiday" 70 | }, 71 | "2016-05-15 00:00:00": { 72 | "name": "스승의날", 73 | "type": "national" 74 | }, 75 | "2016-05-20 00:00:00": { 76 | "name": "소만", 77 | "type": "solarterms" 78 | }, 79 | "2016-06-05 00:00:00": { 80 | "name": "망종", 81 | "type": "solarterms" 82 | }, 83 | "2016-06-06 00:00:00": { 84 | "name": "현충일", 85 | "type": "holiday" 86 | }, 87 | "2016-06-09 00:00:00": { 88 | "name": "단오", 89 | "type": "solarterms" 90 | }, 91 | "2016-06-21 00:00:00": { 92 | "name": "하지", 93 | "type": "solarterms" 94 | }, 95 | "2016-06-25 00:00:00": { 96 | "name": "6.25 한국 전쟁", 97 | "type": "national" 98 | }, 99 | "2016-07-07 00:00:00": { 100 | "name": "소서", 101 | "type": "solarterms" 102 | }, 103 | "2016-07-17 00:00:00": { 104 | "name": "초복", 105 | "type": "solarterms" 106 | }, 107 | "2016-07-22 00:00:00": { 108 | "name": "대서", 109 | "type": "solarterms" 110 | }, 111 | "2016-07-27 00:00:00": { 112 | "name": "중복", 113 | "type": "solarterms" 114 | }, 115 | "2016-08-07 00:00:00": { 116 | "name": "입추", 117 | "type": "solarterms" 118 | }, 119 | "2016-08-15 00:00:00": { 120 | "name": "광복절", 121 | "type": "holiday" 122 | }, 123 | "2016-08-16 00:00:00": { 124 | "name": "말복", 125 | "type": "solarterms" 126 | }, 127 | "2016-08-23 00:00:00": { 128 | "name": "처서", 129 | "type": "solarterms" 130 | }, 131 | "2016-09-07 00:00:00": { 132 | "name": "백로", 133 | "type": "solarterms" 134 | }, 135 | "2016-09-14 00:00:00": { 136 | "name": "추석", 137 | "type": "consecutive" 138 | }, 139 | "2016-09-15 00:00:00": { 140 | "name": "추석", 141 | "type": "holiday" 142 | }, 143 | "2016-09-16 00:00:00": { 144 | "name": "추석", 145 | "type": "consecutive" 146 | }, 147 | "2016-09-22 00:00:00": { 148 | "name": "추분", 149 | "type": "solarterms" 150 | }, 151 | "2016-10-03 00:00:00": { 152 | "name": "개천절", 153 | "type": "holiday" 154 | }, 155 | "2016-10-08 00:00:00": { 156 | "name": "한로", 157 | "type": "solarterms" 158 | }, 159 | "2016-10-09 00:00:00": { 160 | "name": "한글날", 161 | "type": "holiday" 162 | }, 163 | "2016-10-23 00:00:00": { 164 | "name": "상강", 165 | "type": "solarterms" 166 | }, 167 | "2016-11-07 00:00:00": { 168 | "name": "입동", 169 | "type": "solarterms" 170 | }, 171 | "2016-11-22 00:00:00": { 172 | "name": "소설", 173 | "type": "solarterms" 174 | }, 175 | "2016-12-07 00:00:00": { 176 | "name": "대설", 177 | "type": "solarterms" 178 | }, 179 | "2016-12-21 00:00:00": { 180 | "name": "동지", 181 | "type": "solarterms" 182 | }, 183 | "2016-12-25 00:00:00": { 184 | "name": "성탄절", 185 | "type": "holiday" 186 | }, 187 | "2017-01-01 00:00:00": { 188 | "name": "새해 첫날", 189 | "type": "holiday" 190 | }, 191 | "2017-01-05 00:00:00": { 192 | "name": "소한", 193 | "type": "solarterms" 194 | }, 195 | "2017-01-20 00:00:00": { 196 | "name": "대한", 197 | "type": "solarterms" 198 | }, 199 | "2017-01-27 00:00:00": { 200 | "name": "설날", 201 | "type": "consecutive" 202 | }, 203 | "2017-01-28 00:00:00": { 204 | "name": "설날", 205 | "type": "holiday" 206 | }, 207 | "2017-01-29 00:00:00": { 208 | "name": "설날", 209 | "type": "consecutive" 210 | }, 211 | "2017-01-30 00:00:00": { 212 | "name": "대체공휴일(설날)", 213 | "type": "holiday" 214 | }, 215 | "2017-02-04 00:00:00": { 216 | "name": "입춘", 217 | "type": "solarterms" 218 | }, 219 | "2017-02-11 00:00:00": { 220 | "name": "정월 대보름", 221 | "type": "solarterms" 222 | }, 223 | "2017-02-14 00:00:00": { 224 | "name": "밸런타인데이", 225 | "type": "etc" 226 | }, 227 | "2017-02-18 00:00:00": { 228 | "name": "우수", 229 | "type": "solarterms" 230 | }, 231 | "2017-03-01 00:00:00": { 232 | "name": "삼일절", 233 | "type": "holiday" 234 | }, 235 | "2017-03-05 00:00:00": { 236 | "name": "경칩", 237 | "type": "solarterms" 238 | }, 239 | "2017-03-14 00:00:00": { 240 | "name": "화이트데이", 241 | "type": "etc" 242 | }, 243 | "2017-03-20 00:00:00": { 244 | "name": "춘분", 245 | "type": "solarterms" 246 | }, 247 | "2017-04-04 00:00:00": { 248 | "name": "청명", 249 | "type": "solarterms" 250 | }, 251 | "2017-04-05 00:00:00": { 252 | "name": "한식", 253 | "type": "solarterms" 254 | }, 255 | "2017-04-20 00:00:00": { 256 | "name": "곡우", 257 | "type": "solarterms" 258 | }, 259 | "2017-05-01 00:00:00": { 260 | "name": "근로자의날", 261 | "type": "national" 262 | }, 263 | "2017-05-03 00:00:00": { 264 | "name": "석가탄신일", 265 | "type": "holiday" 266 | }, 267 | "2017-05-05 00:00:00": { 268 | "name": "입하", 269 | "type": "solarterms" 270 | }, 271 | "2017-05-08 00:00:00": { 272 | "name": "어버이날", 273 | "type": "national" 274 | }, 275 | "2017-05-10 00:00:00": { 276 | "name": "유권자의날", 277 | "type": "national" 278 | }, 279 | "2017-05-15 00:00:00": { 280 | "name": "스승의날", 281 | "type": "national" 282 | }, 283 | "2017-05-21 00:00:00": { 284 | "name": "소만", 285 | "type": "solarterms" 286 | }, 287 | "2017-05-30 00:00:00": { 288 | "name": "단오", 289 | "type": "solarterms" 290 | }, 291 | "2017-06-05 00:00:00": { 292 | "name": "망종", 293 | "type": "solarterms" 294 | }, 295 | "2017-06-06 00:00:00": { 296 | "name": "현충일", 297 | "type": "holiday" 298 | }, 299 | "2017-06-21 00:00:00": { 300 | "name": "하지", 301 | "type": "solarterms" 302 | }, 303 | "2017-06-25 00:00:00": { 304 | "name": "6.25 한국 전쟁", 305 | "type": "national" 306 | }, 307 | "2017-07-07 00:00:00": { 308 | "name": "소서", 309 | "type": "solarterms" 310 | }, 311 | "2017-07-12 00:00:00": { 312 | "name": "초복", 313 | "type": "solarterms" 314 | }, 315 | "2017-07-17 00:00:00": { 316 | "name": "제헌절", 317 | "type": "national" 318 | }, 319 | "2017-07-22 00:00:00": { 320 | "name": "중복", 321 | "type": "solarterms" 322 | }, 323 | "2017-07-23 00:00:00": { 324 | "name": "대서", 325 | "type": "solarterms" 326 | }, 327 | "2017-08-01 00:00:00": { 328 | "name": "말복", 329 | "type": "solarterms" 330 | }, 331 | "2017-08-07 00:00:00": { 332 | "name": "입추", 333 | "type": "solarterms" 334 | }, 335 | "2017-08-15 00:00:00": { 336 | "name": "광복절", 337 | "type": "holiday" 338 | }, 339 | "2017-08-23 00:00:00": { 340 | "name": "처서", 341 | "type": "solarterms" 342 | }, 343 | "2017-09-07 00:00:00": { 344 | "name": "백로", 345 | "type": "solarterms" 346 | }, 347 | "2017-09-23 00:00:00": { 348 | "name": "추분", 349 | "type": "solarterms" 350 | }, 351 | "2017-10-03 00:00:00": { 352 | "name": "개천절", 353 | "type": "holiday" 354 | }, 355 | "2017-10-04 00:00:00": { 356 | "name": "추석", 357 | "type": "holiday" 358 | }, 359 | "2017-10-05 00:00:00": { 360 | "name": "추석", 361 | "type": "consecutive" 362 | }, 363 | "2017-10-06 00:00:00": { 364 | "name": "대체공휴일(추석)", 365 | "type": "holiday" 366 | }, 367 | "2017-10-08 00:00:00": { 368 | "name": "한로", 369 | "type": "solarterms" 370 | }, 371 | "2017-10-09 00:00:00": { 372 | "name": "한글날", 373 | "type": "holiday" 374 | }, 375 | "2017-10-23 00:00:00": { 376 | "name": "상강", 377 | "type": "solarterms" 378 | }, 379 | "2017-11-07 00:00:00": { 380 | "name": "입동", 381 | "type": "solarterms" 382 | }, 383 | "2017-11-22 00:00:00": { 384 | "name": "소설", 385 | "type": "solarterms" 386 | }, 387 | "2017-12-07 00:00:00": { 388 | "name": "대설", 389 | "type": "solarterms" 390 | }, 391 | "2017-12-20 00:00:00": { 392 | "name": "19대 대통령선거", 393 | "type": "holiday" 394 | }, 395 | "2017-12-22 00:00:00": { 396 | "name": "동지", 397 | "type": "solarterms" 398 | }, 399 | "2017-12-25 00:00:00": { 400 | "name": "성탄절", 401 | "type": "holiday" 402 | }, 403 | "2018-01-01 00:00:00": { 404 | "name": "새해 첫날", 405 | "type": "holiday" 406 | }, 407 | "2018-01-05 00:00:00": { 408 | "name": "소한", 409 | "type": "solarterms" 410 | }, 411 | "2018-01-20 00:00:00": { 412 | "name": "대한", 413 | "type": "solarterms" 414 | }, 415 | "2018-02-04 00:00:00": { 416 | "name": "입춘", 417 | "type": "solarterms" 418 | }, 419 | "2018-02-14 00:00:00": { 420 | "name": "밸런타인데이", 421 | "type": "etc" 422 | }, 423 | "2018-02-15 00:00:00": { 424 | "name": "설날", 425 | "type": "consecutive" 426 | }, 427 | "2018-02-16 00:00:00": { 428 | "name": "설날", 429 | "type": "holiday" 430 | }, 431 | "2018-02-17 00:00:00": { 432 | "name": "설날", 433 | "type": "consecutive" 434 | }, 435 | "2018-02-19 00:00:00": { 436 | "name": "우수", 437 | "type": "solarterms" 438 | }, 439 | "2018-03-01 00:00:00": { 440 | "name": "삼일절", 441 | "type": "holiday" 442 | }, 443 | "2018-03-02 00:00:00": { 444 | "name": "정월 대보름", 445 | "type": "solarterms" 446 | }, 447 | "2018-03-06 00:00:00": { 448 | "name": "경칩", 449 | "type": "solarterms" 450 | }, 451 | "2018-03-14 00:00:00": { 452 | "name": "화이트데이", 453 | "type": "etc" 454 | }, 455 | "2018-03-21 00:00:00": { 456 | "name": "춘분", 457 | "type": "solarterms" 458 | }, 459 | "2018-04-05 00:00:00": { 460 | "name": "청명", 461 | "type": "solarterms" 462 | }, 463 | "2018-04-06 00:00:00": { 464 | "name": "한식", 465 | "type": "solarterms" 466 | }, 467 | "2018-04-20 00:00:00": { 468 | "name": "곡우", 469 | "type": "solarterms" 470 | }, 471 | "2018-05-01 00:00:00": { 472 | "name": "근로자의날", 473 | "type": "national" 474 | }, 475 | "2018-05-05 00:00:00": { 476 | "name": "입하", 477 | "type": "solarterms" 478 | }, 479 | "2018-05-08 00:00:00": { 480 | "name": "어버이날", 481 | "type": "national" 482 | }, 483 | "2018-05-10 00:00:00": { 484 | "name": "유권자의날", 485 | "type": "national" 486 | }, 487 | "2018-05-15 00:00:00": { 488 | "name": "스승의날", 489 | "type": "national" 490 | }, 491 | "2018-05-21 00:00:00": { 492 | "name": "소만", 493 | "type": "solarterms" 494 | }, 495 | "2018-05-22 00:00:00": { 496 | "name": "석가탄신일", 497 | "type": "holiday" 498 | }, 499 | "2018-06-06 00:00:00": { 500 | "name": "망종", 501 | "type": "solarterms" 502 | }, 503 | "2018-06-13 00:00:00": { 504 | "name": "2018 지방선거", 505 | "type": "holiday" 506 | }, 507 | "2018-06-18 00:00:00": { 508 | "name": "단오", 509 | "type": "solarterms" 510 | }, 511 | "2018-06-21 00:00:00": { 512 | "name": "하지", 513 | "type": "solarterms" 514 | }, 515 | "2018-06-25 00:00:00": { 516 | "name": "6.25 한국 전쟁", 517 | "type": "national" 518 | }, 519 | "2018-07-07 00:00:00": { 520 | "name": "소서", 521 | "type": "solarterms" 522 | }, 523 | "2018-07-17 00:00:00": { 524 | "name": "초복", 525 | "type": "solarterms" 526 | }, 527 | "2018-07-23 00:00:00": { 528 | "name": "대서", 529 | "type": "solarterms" 530 | }, 531 | "2018-07-27 00:00:00": { 532 | "name": "중복", 533 | "type": "solarterms" 534 | }, 535 | "2018-08-06 00:00:00": { 536 | "name": "말복", 537 | "type": "solarterms" 538 | }, 539 | "2018-08-07 00:00:00": { 540 | "name": "입추", 541 | "type": "solarterms" 542 | }, 543 | "2018-08-15 00:00:00": { 544 | "name": "광복절", 545 | "type": "holiday" 546 | }, 547 | "2018-08-23 00:00:00": { 548 | "name": "처서", 549 | "type": "solarterms" 550 | }, 551 | "2018-09-08 00:00:00": { 552 | "name": "백로", 553 | "type": "solarterms" 554 | }, 555 | "2018-09-23 00:00:00": { 556 | "name": "추분", 557 | "type": "solarterms" 558 | }, 559 | "2018-09-24 00:00:00": { 560 | "name": "추석", 561 | "type": "holiday" 562 | }, 563 | "2018-09-25 00:00:00": { 564 | "name": "추석", 565 | "type": "consecutive" 566 | }, 567 | "2018-10-03 00:00:00": { 568 | "name": "개천절", 569 | "type": "holiday" 570 | }, 571 | "2018-10-08 00:00:00": { 572 | "name": "한로", 573 | "type": "solarterms" 574 | }, 575 | "2018-10-09 00:00:00": { 576 | "name": "한글날", 577 | "type": "holiday" 578 | }, 579 | "2018-10-23 00:00:00": { 580 | "name": "상강", 581 | "type": "solarterms" 582 | }, 583 | "2018-11-07 00:00:00": { 584 | "name": "입동", 585 | "type": "solarterms" 586 | }, 587 | "2018-11-22 00:00:00": { 588 | "name": "소설", 589 | "type": "solarterms" 590 | }, 591 | "2018-12-07 00:00:00": { 592 | "name": "대설", 593 | "type": "solarterms" 594 | }, 595 | "2018-12-22 00:00:00": { 596 | "name": "동지", 597 | "type": "solarterms" 598 | }, 599 | "2018-12-25 00:00:00": { 600 | "name": "성탄절", 601 | "type": "holiday" 602 | }, 603 | "2019-01-01 00:00:00": { 604 | "name": "새해 첫날", 605 | "type": "holiday" 606 | }, 607 | "2019-01-06 00:00:00": { 608 | "name": "소한", 609 | "type": "solarterms" 610 | }, 611 | "2019-01-20 00:00:00": { 612 | "name": "대한", 613 | "type": "solarterms" 614 | }, 615 | "2019-02-04 00:00:00": { 616 | "name": "입춘", 617 | "type": "solarterms" 618 | }, 619 | "2019-02-05 00:00:00": { 620 | "name": "설날", 621 | "type": "holiday" 622 | }, 623 | "2019-02-06 00:00:00": { 624 | "name": "설날", 625 | "type": "consecutive" 626 | }, 627 | "2019-02-14 00:00:00": { 628 | "name": "밸런타인데이", 629 | "type": "etc" 630 | }, 631 | "2019-02-19 00:00:00": { 632 | "name": "정월 대보름", 633 | "type": "solarterms" 634 | }, 635 | "2019-03-01 00:00:00": { 636 | "name": "삼일절", 637 | "type": "holiday" 638 | }, 639 | "2019-03-06 00:00:00": { 640 | "name": "조합장선거", 641 | "type": "solarterms" 642 | }, 643 | "2019-03-14 00:00:00": { 644 | "name": "화이트데이", 645 | "type": "etc" 646 | }, 647 | "2019-03-21 00:00:00": { 648 | "name": "춘분", 649 | "type": "solarterms" 650 | }, 651 | "2019-04-05 00:00:00": { 652 | "name": "청명", 653 | "type": "solarterms" 654 | }, 655 | "2019-04-06 00:00:00": { 656 | "name": "한식", 657 | "type": "solarterms" 658 | }, 659 | "2019-04-20 00:00:00": { 660 | "name": "곡우", 661 | "type": "solarterms" 662 | }, 663 | "2019-05-01 00:00:00": { 664 | "name": "근로자의날", 665 | "type": "national" 666 | }, 667 | "2019-05-05 00:00:00": { 668 | "name": "어린이날", 669 | "type": "holiday" 670 | }, 671 | "2019-05-06 00:00:00": { 672 | "name": "입하", 673 | "type": "solarterms" 674 | }, 675 | "2019-05-08 00:00:00": { 676 | "name": "어버이날", 677 | "type": "national" 678 | }, 679 | "2019-05-10 00:00:00": { 680 | "name": "유권자의날", 681 | "type": "national" 682 | }, 683 | "2019-05-12 00:00:00": { 684 | "name": "석가탄신일", 685 | "type": "holiday" 686 | }, 687 | "2019-05-15 00:00:00": { 688 | "name": "스승의날", 689 | "type": "national" 690 | }, 691 | "2019-05-21 00:00:00": { 692 | "name": "소만", 693 | "type": "solarterms" 694 | }, 695 | "2019-06-06 00:00:00": { 696 | "name": "현충일", 697 | "type": "holiday" 698 | }, 699 | "2019-06-07 00:00:00": { 700 | "name": "단오", 701 | "type": "solarterms" 702 | }, 703 | "2019-06-25 00:00:00": { 704 | "name": "6.25 한국 전쟁", 705 | "type": "national" 706 | }, 707 | "2019-07-07 00:00:00": { 708 | "name": "소서", 709 | "type": "solarterms" 710 | }, 711 | "2019-07-17 00:00:00": { 712 | "name": "제헌절", 713 | "type": "national" 714 | }, 715 | "2019-07-23 00:00:00": { 716 | "name": "대서", 717 | "type": "solarterms" 718 | }, 719 | "2019-08-08 00:00:00": { 720 | "name": "입추", 721 | "type": "solarterms" 722 | }, 723 | "2019-08-15 00:00:00": { 724 | "name": "광복절", 725 | "type": "holiday" 726 | }, 727 | "2019-08-23 00:00:00": { 728 | "name": "처서", 729 | "type": "solarterms" 730 | }, 731 | "2019-09-08 00:00:00": { 732 | "name": "백로", 733 | "type": "solarterms" 734 | }, 735 | "2019-09-12 00:00:00": { 736 | "name": "추석", 737 | "type": "consecutive" 738 | }, 739 | "2019-09-13 00:00:00": { 740 | "name": "추석", 741 | "type": "holiday" 742 | }, 743 | "2019-09-14 00:00:00": { 744 | "name": "추석", 745 | "type": "consecutive" 746 | }, 747 | "2019-09-23 00:00:00": { 748 | "name": "추분", 749 | "type": "solarterms" 750 | }, 751 | "2019-10-03 00:00:00": { 752 | "name": "개천절", 753 | "type": "holiday" 754 | }, 755 | "2019-10-08 00:00:00": { 756 | "name": "한로", 757 | "type": "solarterms" 758 | }, 759 | "2019-10-09 00:00:00": { 760 | "name": "한글날", 761 | "type": "holiday" 762 | }, 763 | "2019-10-24 00:00:00": { 764 | "name": "상강", 765 | "type": "solarterms" 766 | }, 767 | "2019-11-08 00:00:00": { 768 | "name": "입동", 769 | "type": "solarterms" 770 | }, 771 | "2019-11-22 00:00:00": { 772 | "name": "소설", 773 | "type": "solarterms" 774 | }, 775 | "2019-12-07 00:00:00": { 776 | "name": "대설", 777 | "type": "solarterms" 778 | }, 779 | "2019-12-22 00:00:00": { 780 | "name": "동지", 781 | "type": "solarterms" 782 | }, 783 | "2019-12-25 00:00:00": { 784 | "name": "성탄절", 785 | "type": "holiday" 786 | }, 787 | "2020-01-01 00:00:00": { 788 | "name": "새해 첫날", 789 | "type": "holiday" 790 | }, 791 | "2020-01-06 00:00:00": { 792 | "name": "소한", 793 | "type": "solarterms" 794 | }, 795 | "2020-01-20 00:00:00": { 796 | "name": "대한", 797 | "type": "solarterms" 798 | }, 799 | "2020-01-24 00:00:00": { 800 | "name": "설날", 801 | "type": "consecutive" 802 | }, 803 | "2020-01-25 00:00:00": { 804 | "name": "설날", 805 | "type": "holiday" 806 | }, 807 | "2020-01-26 00:00:00": { 808 | "name": "설날", 809 | "type": "consecutive" 810 | }, 811 | "2020-02-04 00:00:00": { 812 | "name": "입춘", 813 | "type": "solarterms" 814 | }, 815 | "2020-02-08 00:00:00": { 816 | "name": "정월 대보름", 817 | "type": "solarterms" 818 | }, 819 | "2020-02-14 00:00:00": { 820 | "name": "밸런타인데이", 821 | "type": "etc" 822 | }, 823 | "2020-02-19 00:00:00": { 824 | "name": "우수", 825 | "type": "solarterms" 826 | }, 827 | "2020-03-01 00:00:00": { 828 | "name": "삼일절", 829 | "type": "holiday" 830 | }, 831 | "2020-03-05 00:00:00": { 832 | "name": "경칩", 833 | "type": "solarterms" 834 | }, 835 | "2020-03-14 00:00:00": { 836 | "name": "화이트데이", 837 | "type": "etc" 838 | }, 839 | "2020-03-20 00:00:00": { 840 | "name": "춘분", 841 | "type": "solarterms" 842 | }, 843 | "2020-04-04 00:00:00": { 844 | "name": "청명", 845 | "type": "solarterms" 846 | }, 847 | "2020-04-05 00:00:00": { 848 | "name": "한식", 849 | "type": "solarterms" 850 | }, 851 | "2020-04-15 00:00:00": { 852 | "name": "21대 국회의원선거", 853 | "type": "holiday" 854 | }, 855 | "2020-04-19 00:00:00": { 856 | "name": "곡우", 857 | "type": "solarterms" 858 | }, 859 | "2020-04-30 00:00:00": { 860 | "name": "석가탄신일", 861 | "type": "holiday" 862 | }, 863 | "2020-05-01 00:00:00": { 864 | "name": "근로자의날", 865 | "type": "national" 866 | }, 867 | "2020-05-05 00:00:00": { 868 | "name": "입하", 869 | "type": "solarterms" 870 | }, 871 | "2020-05-08 00:00:00": { 872 | "name": "어버이날", 873 | "type": "national" 874 | }, 875 | "2020-05-10 00:00:00": { 876 | "name": "유권자의날", 877 | "type": "national" 878 | }, 879 | "2020-05-15 00:00:00": { 880 | "name": "스승의날", 881 | "type": "national" 882 | }, 883 | "2020-05-20 00:00:00": { 884 | "name": "소만", 885 | "type": "solarterms" 886 | }, 887 | "2020-06-05 00:00:00": { 888 | "name": "망종", 889 | "type": "solarterms" 890 | }, 891 | "2020-06-06 00:00:00": { 892 | "name": "현충일", 893 | "type": "holiday" 894 | }, 895 | "2020-06-21 00:00:00": { 896 | "name": "하지", 897 | "type": "solarterms" 898 | }, 899 | "2020-06-25 00:00:00": { 900 | "name": "단오", 901 | "type": "solarterms" 902 | }, 903 | "2020-07-07 00:00:00": { 904 | "name": "소서", 905 | "type": "solarterms" 906 | }, 907 | "2020-07-16 00:00:00": { 908 | "name": "초복", 909 | "type": "solarterms" 910 | }, 911 | "2020-07-17 00:00:00": { 912 | "name": "제헌절", 913 | "type": "national" 914 | }, 915 | "2020-07-22 00:00:00": { 916 | "name": "대서", 917 | "type": "solarterms" 918 | }, 919 | "2020-07-26 00:00:00": { 920 | "name": "중복", 921 | "type": "solarterms" 922 | }, 923 | "2020-08-05 00:00:00": { 924 | "name": "말복", 925 | "type": "solarterms" 926 | }, 927 | "2020-08-07 00:00:00": { 928 | "name": "입추", 929 | "type": "solarterms" 930 | }, 931 | "2020-08-15 00:00:00": { 932 | "name": "광복절", 933 | "type": "holiday" 934 | }, 935 | "2020-08-23 00:00:00": { 936 | "name": "처서", 937 | "type": "solarterms" 938 | }, 939 | "2020-09-07 00:00:00": { 940 | "name": "백로", 941 | "type": "solarterms" 942 | }, 943 | "2020-09-22 00:00:00": { 944 | "name": "추분", 945 | "type": "solarterms" 946 | }, 947 | "2020-09-30 00:00:00": { 948 | "name": "추석", 949 | "type": "consecutive" 950 | }, 951 | "2020-10-01 00:00:00": { 952 | "name": "추석", 953 | "type": "holiday" 954 | }, 955 | "2020-10-02 00:00:00": { 956 | "name": "추석", 957 | "type": "consecutive" 958 | }, 959 | "2020-10-03 00:00:00": { 960 | "name": "개천절", 961 | "type": "holiday" 962 | }, 963 | "2020-10-08 00:00:00": { 964 | "name": "한로", 965 | "type": "solarterms" 966 | }, 967 | "2020-10-09 00:00:00": { 968 | "name": "한글날", 969 | "type": "holiday" 970 | }, 971 | "2020-10-23 00:00:00": { 972 | "name": "상강", 973 | "type": "solarterms" 974 | }, 975 | "2020-11-07 00:00:00": { 976 | "name": "입동", 977 | "type": "solarterms" 978 | }, 979 | "2020-11-22 00:00:00": { 980 | "name": "소설", 981 | "type": "solarterms" 982 | }, 983 | "2020-12-07 00:00:00": { 984 | "name": "대설", 985 | "type": "solarterms" 986 | }, 987 | "2020-12-21 00:00:00": { 988 | "name": "동지", 989 | "type": "solarterms" 990 | }, 991 | "2020-12-25 00:00:00": { 992 | "name": "성탄절", 993 | "type": "holiday" 994 | }, 995 | "2021-01-01 00:00:00": { 996 | "name": "새해 첫날", 997 | "type": "holiday" 998 | }, 999 | "2021-01-05 00:00:00": { 1000 | "name": "소한", 1001 | "type": "solarterms" 1002 | }, 1003 | "2021-01-20 00:00:00": { 1004 | "name": "대한", 1005 | "type": "solarterms" 1006 | }, 1007 | "2021-02-03 00:00:00": { 1008 | "name": "입춘", 1009 | "type": "solarterms" 1010 | }, 1011 | "2021-02-11 00:00:00": { 1012 | "name": "설날", 1013 | "type": "consecutive" 1014 | }, 1015 | "2021-02-12 00:00:00": { 1016 | "name": "설날", 1017 | "type": "holiday" 1018 | }, 1019 | "2021-02-13 00:00:00": { 1020 | "name": "설날", 1021 | "type": "consecutive" 1022 | }, 1023 | "2021-02-14 00:00:00": { 1024 | "name": "밸런타인데이", 1025 | "type": "etc" 1026 | }, 1027 | "2021-02-18 00:00:00": { 1028 | "name": "우수", 1029 | "type": "solarterms" 1030 | }, 1031 | "2021-02-26 00:00:00": { 1032 | "name": "정월 대보름", 1033 | "type": "solarterms" 1034 | }, 1035 | "2021-03-01 00:00:00": { 1036 | "name": "삼일절", 1037 | "type": "holiday" 1038 | }, 1039 | "2021-03-05 00:00:00": { 1040 | "name": "경칩", 1041 | "type": "solarterms" 1042 | }, 1043 | "2021-03-14 00:00:00": { 1044 | "name": "화이트데이", 1045 | "type": "etc" 1046 | }, 1047 | "2021-03-20 00:00:00": { 1048 | "name": "춘분", 1049 | "type": "solarterms" 1050 | }, 1051 | "2021-04-04 00:00:00": { 1052 | "name": "청명", 1053 | "type": "solarterms" 1054 | }, 1055 | "2021-04-05 00:00:00": { 1056 | "name": "한식", 1057 | "type": "solarterms" 1058 | }, 1059 | "2021-04-20 00:00:00": { 1060 | "name": "곡우", 1061 | "type": "solarterms" 1062 | }, 1063 | "2021-05-01 00:00:00": { 1064 | "name": "근로자의날", 1065 | "type": "national" 1066 | }, 1067 | "2021-05-05 00:00:00": { 1068 | "name": "입하", 1069 | "type": "solarterms" 1070 | }, 1071 | "2021-05-08 00:00:00": { 1072 | "name": "어버이날", 1073 | "type": "national" 1074 | }, 1075 | "2021-05-10 00:00:00": { 1076 | "name": "유권자의날", 1077 | "type": "national" 1078 | }, 1079 | "2021-05-15 00:00:00": { 1080 | "name": "스승의날", 1081 | "type": "national" 1082 | }, 1083 | "2021-05-19 00:00:00": { 1084 | "name": "석가탄신일", 1085 | "type": "holiday" 1086 | }, 1087 | "2021-05-21 00:00:00": { 1088 | "name": "소만", 1089 | "type": "solarterms" 1090 | }, 1091 | "2021-06-05 00:00:00": { 1092 | "name": "망종", 1093 | "type": "solarterms" 1094 | }, 1095 | "2021-06-06 00:00:00": { 1096 | "name": "현충일", 1097 | "type": "holiday" 1098 | }, 1099 | "2021-06-14 00:00:00": { 1100 | "name": "단오", 1101 | "type": "solarterms" 1102 | }, 1103 | "2021-06-21 00:00:00": { 1104 | "name": "하지", 1105 | "type": "solarterms" 1106 | }, 1107 | "2021-06-25 00:00:00": { 1108 | "name": "6.25 한국 전쟁", 1109 | "type": "national" 1110 | }, 1111 | "2021-07-07 00:00:00": { 1112 | "name": "소서", 1113 | "type": "solarterms" 1114 | }, 1115 | "2021-07-11 00:00:00": { 1116 | "name": "초복", 1117 | "type": "solarterms" 1118 | }, 1119 | "2021-07-17 00:00:00": { 1120 | "name": "제헌절", 1121 | "type": "national" 1122 | }, 1123 | "2021-07-21 00:00:00": { 1124 | "name": "중복", 1125 | "type": "solarterms" 1126 | }, 1127 | "2021-07-22 00:00:00": { 1128 | "name": "대서", 1129 | "type": "solarterms" 1130 | }, 1131 | "2021-07-31 00:00:00": { 1132 | "name": "말복", 1133 | "type": "solarterms" 1134 | }, 1135 | "2021-08-07 00:00:00": { 1136 | "name": "입추", 1137 | "type": "solarterms" 1138 | }, 1139 | "2021-08-15 00:00:00": { 1140 | "name": "광복절", 1141 | "type": "holiday" 1142 | }, 1143 | "2021-08-23 00:00:00": { 1144 | "name": "처서", 1145 | "type": "solarterms" 1146 | }, 1147 | "2021-09-07 00:00:00": { 1148 | "name": "백로", 1149 | "type": "solarterms" 1150 | }, 1151 | "2021-09-20 00:00:00": { 1152 | "name": "추석", 1153 | "type": "consecutive" 1154 | }, 1155 | "2021-09-21 00:00:00": { 1156 | "name": "추석", 1157 | "type": "holiday" 1158 | }, 1159 | "2021-09-22 00:00:00": { 1160 | "name": "추석", 1161 | "type": "consecutive" 1162 | }, 1163 | "2021-09-23 00:00:00": { 1164 | "name": "추분", 1165 | "type": "solarterms" 1166 | }, 1167 | "2021-10-03 00:00:00": { 1168 | "name": "개천절", 1169 | "type": "holiday" 1170 | }, 1171 | "2021-10-08 00:00:00": { 1172 | "name": "한로", 1173 | "type": "solarterms" 1174 | }, 1175 | "2021-10-09 00:00:00": { 1176 | "name": "한글날", 1177 | "type": "holiday" 1178 | }, 1179 | "2021-10-23 00:00:00": { 1180 | "name": "상강", 1181 | "type": "solarterms" 1182 | }, 1183 | "2021-11-07 00:00:00": { 1184 | "name": "입동", 1185 | "type": "solarterms" 1186 | }, 1187 | "2021-11-22 00:00:00": { 1188 | "name": "소설", 1189 | "type": "solarterms" 1190 | }, 1191 | "2021-12-07 00:00:00": { 1192 | "name": "대설", 1193 | "type": "solarterms" 1194 | }, 1195 | "2021-12-22 00:00:00": { 1196 | "name": "동지", 1197 | "type": "solarterms" 1198 | }, 1199 | "2021-12-25 00:00:00": { 1200 | "name": "성탄절", 1201 | "type": "holiday" 1202 | }, 1203 | "2022-01-01 00:00:00": { 1204 | "name": "새해 첫날", 1205 | "type": "holiday" 1206 | }, 1207 | "2022-01-05 00:00:00": { 1208 | "name": "소한", 1209 | "type": "solarterms" 1210 | }, 1211 | "2022-01-20 00:00:00": { 1212 | "name": "대한", 1213 | "type": "solarterms" 1214 | }, 1215 | "2022-01-31 00:00:00": { 1216 | "name": "설날", 1217 | "type": "consecutive" 1218 | }, 1219 | "2022-02-01 00:00:00": { 1220 | "name": "설날", 1221 | "type": "holiday" 1222 | }, 1223 | "2022-02-02 00:00:00": { 1224 | "name": "설날", 1225 | "type": "consecutive" 1226 | }, 1227 | "2022-02-04 00:00:00": { 1228 | "name": "입춘", 1229 | "type": "solarterms" 1230 | }, 1231 | "2022-02-14 00:00:00": { 1232 | "name": "밸런타인데이", 1233 | "type": "etc" 1234 | }, 1235 | "2022-02-15 00:00:00": { 1236 | "name": "정월 대보름", 1237 | "type": "solarterms" 1238 | }, 1239 | "2022-02-19 00:00:00": { 1240 | "name": "우수", 1241 | "type": "solarterms" 1242 | }, 1243 | "2022-03-01 00:00:00": { 1244 | "name": "삼일절", 1245 | "type": "holiday" 1246 | }, 1247 | "2022-03-05 00:00:00": { 1248 | "name": "경칩", 1249 | "type": "solarterms" 1250 | }, 1251 | "2022-03-14 00:00:00": { 1252 | "name": "화이트데이", 1253 | "type": "etc" 1254 | }, 1255 | "2022-03-21 00:00:00": { 1256 | "name": "춘분", 1257 | "type": "solarterms" 1258 | }, 1259 | "2022-04-05 00:00:00": { 1260 | "name": "청명", 1261 | "type": "solarterms" 1262 | }, 1263 | "2022-04-06 00:00:00": { 1264 | "name": "한식", 1265 | "type": "solarterms" 1266 | }, 1267 | "2022-04-20 00:00:00": { 1268 | "name": "곡우", 1269 | "type": "solarterms" 1270 | }, 1271 | "2022-05-01 00:00:00": { 1272 | "name": "근로자의날", 1273 | "type": "national" 1274 | }, 1275 | "2022-05-05 00:00:00": { 1276 | "name": "입하", 1277 | "type": "solarterms" 1278 | }, 1279 | "2022-05-08 00:00:00": { 1280 | "name": "어버이날", 1281 | "type": "national" 1282 | }, 1283 | "2022-05-10 00:00:00": { 1284 | "name": "유권자의날", 1285 | "type": "national" 1286 | }, 1287 | "2022-05-15 00:00:00": { 1288 | "name": "스승의날", 1289 | "type": "national" 1290 | }, 1291 | "2022-05-21 00:00:00": { 1292 | "name": "소만", 1293 | "type": "solarterms" 1294 | }, 1295 | "2022-06-01 00:00:00": { 1296 | "name": "2022 지방선거", 1297 | "type": "holiday" 1298 | }, 1299 | "2022-06-03 00:00:00": { 1300 | "name": "단오", 1301 | "type": "solarterms" 1302 | }, 1303 | "2022-06-06 00:00:00": { 1304 | "name": "망종", 1305 | "type": "solarterms" 1306 | }, 1307 | "2022-06-21 00:00:00": { 1308 | "name": "하지", 1309 | "type": "solarterms" 1310 | }, 1311 | "2022-06-25 00:00:00": { 1312 | "name": "6.25 한국 전쟁", 1313 | "type": "national" 1314 | }, 1315 | "2022-07-07 00:00:00": { 1316 | "name": "소서", 1317 | "type": "solarterms" 1318 | }, 1319 | "2022-07-16 00:00:00": { 1320 | "name": "초복", 1321 | "type": "solarterms" 1322 | }, 1323 | "2022-07-17 00:00:00": { 1324 | "name": "제헌절", 1325 | "type": "national" 1326 | }, 1327 | "2022-07-23 00:00:00": { 1328 | "name": "대서", 1329 | "type": "solarterms" 1330 | }, 1331 | "2022-07-26 00:00:00": { 1332 | "name": "중복", 1333 | "type": "solarterms" 1334 | }, 1335 | "2022-08-05 00:00:00": { 1336 | "name": "말복", 1337 | "type": "solarterms" 1338 | }, 1339 | "2022-08-07 00:00:00": { 1340 | "name": "입추", 1341 | "type": "solarterms" 1342 | }, 1343 | "2022-08-15 00:00:00": { 1344 | "name": "광복절", 1345 | "type": "holiday" 1346 | }, 1347 | "2022-08-23 00:00:00": { 1348 | "name": "처서", 1349 | "type": "solarterms" 1350 | }, 1351 | "2022-09-08 00:00:00": { 1352 | "name": "백로", 1353 | "type": "solarterms" 1354 | }, 1355 | "2022-09-09 00:00:00": { 1356 | "name": "추석", 1357 | "type": "consecutive" 1358 | }, 1359 | "2022-09-10 00:00:00": { 1360 | "name": "추석", 1361 | "type": "holiday" 1362 | }, 1363 | "2022-09-11 00:00:00": { 1364 | "name": "추석", 1365 | "type": "consecutive" 1366 | }, 1367 | "2022-09-23 00:00:00": { 1368 | "name": "추분", 1369 | "type": "solarterms" 1370 | }, 1371 | "2022-10-03 00:00:00": { 1372 | "name": "개천절", 1373 | "type": "holiday" 1374 | }, 1375 | "2022-10-08 00:00:00": { 1376 | "name": "한로", 1377 | "type": "solarterms" 1378 | }, 1379 | "2022-10-09 00:00:00": { 1380 | "name": "한글날", 1381 | "type": "holiday" 1382 | }, 1383 | "2022-10-23 00:00:00": { 1384 | "name": "상강", 1385 | "type": "solarterms" 1386 | }, 1387 | "2022-11-07 00:00:00": { 1388 | "name": "입동", 1389 | "type": "solarterms" 1390 | }, 1391 | "2022-11-22 00:00:00": { 1392 | "name": "소설", 1393 | "type": "solarterms" 1394 | }, 1395 | "2022-12-07 00:00:00": { 1396 | "name": "대설", 1397 | "type": "solarterms" 1398 | }, 1399 | "2022-12-21 00:00:00": { 1400 | "name": "20대 대통령선거", 1401 | "type": "holiday" 1402 | }, 1403 | "2022-12-22 00:00:00": { 1404 | "name": "동지", 1405 | "type": "solarterms" 1406 | }, 1407 | "2022-12-25 00:00:00": { 1408 | "name": "성탄절", 1409 | "type": "holiday" 1410 | }, 1411 | "2023-01-01 00:00:00": { 1412 | "name": "새해 첫날", 1413 | "type": "holiday" 1414 | }, 1415 | "2023-01-05 00:00:00": { 1416 | "name": "소한", 1417 | "type": "solarterms" 1418 | }, 1419 | "2023-01-20 00:00:00": { 1420 | "name": "대한", 1421 | "type": "solarterms" 1422 | }, 1423 | "2023-01-21 00:00:00": { 1424 | "name": "설날", 1425 | "type": "consecutive" 1426 | }, 1427 | "2023-01-22 00:00:00": { 1428 | "name": "설날", 1429 | "type": "holiday" 1430 | }, 1431 | "2023-01-23 00:00:00": { 1432 | "name": "설날", 1433 | "type": "consecutive" 1434 | }, 1435 | "2023-02-04 00:00:00": { 1436 | "name": "입춘", 1437 | "type": "solarterms" 1438 | }, 1439 | "2023-02-05 00:00:00": { 1440 | "name": "정월 대보름", 1441 | "type": "solarterms" 1442 | }, 1443 | "2023-02-14 00:00:00": { 1444 | "name": "밸런타인데이", 1445 | "type": "etc" 1446 | }, 1447 | "2023-02-19 00:00:00": { 1448 | "name": "우수", 1449 | "type": "solarterms" 1450 | }, 1451 | "2023-03-01 00:00:00": { 1452 | "name": "삼일절", 1453 | "type": "holiday" 1454 | }, 1455 | "2023-03-06 00:00:00": { 1456 | "name": "경칩", 1457 | "type": "solarterms" 1458 | }, 1459 | "2023-03-08 00:00:00": { 1460 | "name": "조합장선거", 1461 | "type": "solarterms" 1462 | }, 1463 | "2023-03-14 00:00:00": { 1464 | "name": "화이트데이", 1465 | "type": "etc" 1466 | }, 1467 | "2023-03-21 00:00:00": { 1468 | "name": "춘분", 1469 | "type": "solarterms" 1470 | }, 1471 | "2023-04-05 00:00:00": { 1472 | "name": "청명", 1473 | "type": "solarterms" 1474 | }, 1475 | "2023-04-06 00:00:00": { 1476 | "name": "한식", 1477 | "type": "solarterms" 1478 | }, 1479 | "2023-04-20 00:00:00": { 1480 | "name": "곡우", 1481 | "type": "solarterms" 1482 | }, 1483 | "2023-05-01 00:00:00": { 1484 | "name": "근로자의날", 1485 | "type": "national" 1486 | }, 1487 | "2023-05-05 00:00:00": { 1488 | "name": "어린이날", 1489 | "type": "holiday" 1490 | }, 1491 | "2023-05-06 00:00:00": { 1492 | "name": "입하", 1493 | "type": "solarterms" 1494 | }, 1495 | "2023-05-08 00:00:00": { 1496 | "name": "어버이날", 1497 | "type": "national" 1498 | }, 1499 | "2023-05-10 00:00:00": { 1500 | "name": "유권자의날", 1501 | "type": "national" 1502 | }, 1503 | "2023-05-15 00:00:00": { 1504 | "name": "스승의날", 1505 | "type": "national" 1506 | }, 1507 | "2023-05-21 00:00:00": { 1508 | "name": "소만", 1509 | "type": "solarterms" 1510 | }, 1511 | "2023-05-27 00:00:00": { 1512 | "name": "석가탄신일", 1513 | "type": "holiday" 1514 | }, 1515 | "2023-06-06 00:00:00": { 1516 | "name": "망종", 1517 | "type": "solarterms" 1518 | }, 1519 | "2023-06-22 00:00:00": { 1520 | "name": "단오", 1521 | "type": "solarterms" 1522 | }, 1523 | "2023-06-25 00:00:00": { 1524 | "name": "6.25 한국 전쟁", 1525 | "type": "national" 1526 | }, 1527 | "2023-07-07 00:00:00": { 1528 | "name": "소서", 1529 | "type": "solarterms" 1530 | }, 1531 | "2023-07-17 00:00:00": { 1532 | "name": "제헌절", 1533 | "type": "national" 1534 | }, 1535 | "2023-07-21 00:00:00": { 1536 | "name": "초복", 1537 | "type": "solarterms" 1538 | }, 1539 | "2023-07-23 00:00:00": { 1540 | "name": "대서", 1541 | "type": "solarterms" 1542 | }, 1543 | "2023-07-31 00:00:00": { 1544 | "name": "중복", 1545 | "type": "solarterms" 1546 | }, 1547 | "2023-08-08 00:00:00": { 1548 | "name": "입추", 1549 | "type": "solarterms" 1550 | }, 1551 | "2023-08-10 00:00:00": { 1552 | "name": "말복", 1553 | "type": "solarterms" 1554 | }, 1555 | "2023-08-15 00:00:00": { 1556 | "name": "광복절", 1557 | "type": "holiday" 1558 | }, 1559 | "2023-08-23 00:00:00": { 1560 | "name": "처서", 1561 | "type": "solarterms" 1562 | }, 1563 | "2023-09-08 00:00:00": { 1564 | "name": "백로", 1565 | "type": "solarterms" 1566 | }, 1567 | "2023-09-23 00:00:00": { 1568 | "name": "추분", 1569 | "type": "solarterms" 1570 | }, 1571 | "2023-09-28 00:00:00": { 1572 | "name": "추석", 1573 | "type": "consecutive" 1574 | }, 1575 | "2023-09-29 00:00:00": { 1576 | "name": "추석", 1577 | "type": "holiday" 1578 | }, 1579 | "2023-09-30 00:00:00": { 1580 | "name": "추석", 1581 | "type": "consecutive" 1582 | }, 1583 | "2023-10-03 00:00:00": { 1584 | "name": "개천절", 1585 | "type": "holiday" 1586 | }, 1587 | "2023-10-08 00:00:00": { 1588 | "name": "한로", 1589 | "type": "solarterms" 1590 | }, 1591 | "2023-10-09 00:00:00": { 1592 | "name": "한글날", 1593 | "type": "holiday" 1594 | }, 1595 | "2023-10-24 00:00:00": { 1596 | "name": "상강", 1597 | "type": "solarterms" 1598 | }, 1599 | "2023-11-08 00:00:00": { 1600 | "name": "입동", 1601 | "type": "solarterms" 1602 | }, 1603 | "2023-11-22 00:00:00": { 1604 | "name": "소설", 1605 | "type": "solarterms" 1606 | }, 1607 | "2023-12-07 00:00:00": { 1608 | "name": "대설", 1609 | "type": "solarterms" 1610 | }, 1611 | "2023-12-22 00:00:00": { 1612 | "name": "동지", 1613 | "type": "solarterms" 1614 | }, 1615 | "2023-12-25 00:00:00": { 1616 | "name": "성탄절", 1617 | "type": "holiday" 1618 | }, 1619 | "2024-01-01 00:00:00": { 1620 | "name": "새해 첫날", 1621 | "type": "holiday" 1622 | }, 1623 | "2024-01-06 00:00:00": { 1624 | "name": "소한", 1625 | "type": "solarterms" 1626 | }, 1627 | "2024-01-20 00:00:00": { 1628 | "name": "대한", 1629 | "type": "solarterms" 1630 | }, 1631 | "2024-02-04 00:00:00": { 1632 | "name": "입춘", 1633 | "type": "solarterms" 1634 | }, 1635 | "2024-02-09 00:00:00": { 1636 | "name": "설날", 1637 | "type": "consecutive" 1638 | }, 1639 | "2024-02-10 00:00:00": { 1640 | "name": "설날", 1641 | "type": "holiday" 1642 | }, 1643 | "2024-02-11 00:00:00": { 1644 | "name": "설날", 1645 | "type": "consecutive" 1646 | }, 1647 | "2024-02-14 00:00:00": { 1648 | "name": "밸런타인데이", 1649 | "type": "etc" 1650 | }, 1651 | "2024-02-19 00:00:00": { 1652 | "name": "우수", 1653 | "type": "solarterms" 1654 | }, 1655 | "2024-02-24 00:00:00": { 1656 | "name": "정월 대보름", 1657 | "type": "solarterms" 1658 | }, 1659 | "2024-03-01 00:00:00": { 1660 | "name": "삼일절", 1661 | "type": "holiday" 1662 | }, 1663 | "2024-03-05 00:00:00": { 1664 | "name": "경칩", 1665 | "type": "solarterms" 1666 | }, 1667 | "2024-03-14 00:00:00": { 1668 | "name": "화이트데이", 1669 | "type": "etc" 1670 | }, 1671 | "2024-03-20 00:00:00": { 1672 | "name": "춘분", 1673 | "type": "solarterms" 1674 | }, 1675 | "2024-04-04 00:00:00": { 1676 | "name": "청명", 1677 | "type": "solarterms" 1678 | }, 1679 | "2024-04-05 00:00:00": { 1680 | "name": "한식", 1681 | "type": "solarterms" 1682 | }, 1683 | "2024-04-10 00:00:00": { 1684 | "name": "22대 국회의원선거", 1685 | "type": "holiday" 1686 | }, 1687 | "2024-04-19 00:00:00": { 1688 | "name": "곡우", 1689 | "type": "solarterms" 1690 | }, 1691 | "2024-05-01 00:00:00": { 1692 | "name": "근로자의날", 1693 | "type": "national" 1694 | }, 1695 | "2024-05-05 00:00:00": { 1696 | "name": "입하", 1697 | "type": "solarterms" 1698 | }, 1699 | "2024-05-08 00:00:00": { 1700 | "name": "어버이날", 1701 | "type": "national" 1702 | }, 1703 | "2024-05-10 00:00:00": { 1704 | "name": "유권자의날", 1705 | "type": "national" 1706 | }, 1707 | "2024-05-15 00:00:00": { 1708 | "name": "스승의날", 1709 | "type": "national" 1710 | }, 1711 | "2024-05-20 00:00:00": { 1712 | "name": "소만", 1713 | "type": "solarterms" 1714 | }, 1715 | "2024-06-05 00:00:00": { 1716 | "name": "망종", 1717 | "type": "solarterms" 1718 | }, 1719 | "2024-06-06 00:00:00": { 1720 | "name": "현충일", 1721 | "type": "holiday" 1722 | }, 1723 | "2024-06-10 00:00:00": { 1724 | "name": "단오", 1725 | "type": "solarterms" 1726 | }, 1727 | "2024-06-21 00:00:00": { 1728 | "name": "하지", 1729 | "type": "solarterms" 1730 | }, 1731 | "2024-06-25 00:00:00": { 1732 | "name": "6.25 한국 전쟁", 1733 | "type": "national" 1734 | }, 1735 | "2024-07-06 00:00:00": { 1736 | "name": "소서", 1737 | "type": "solarterms" 1738 | }, 1739 | "2024-07-15 00:00:00": { 1740 | "name": "초복", 1741 | "type": "solarterms" 1742 | }, 1743 | "2024-07-17 00:00:00": { 1744 | "name": "제헌절", 1745 | "type": "national" 1746 | }, 1747 | "2024-07-22 00:00:00": { 1748 | "name": "대서", 1749 | "type": "solarterms" 1750 | }, 1751 | "2024-07-25 00:00:00": { 1752 | "name": "중복", 1753 | "type": "solarterms" 1754 | }, 1755 | "2024-08-04 00:00:00": { 1756 | "name": "말복", 1757 | "type": "solarterms" 1758 | }, 1759 | "2024-08-07 00:00:00": { 1760 | "name": "입추", 1761 | "type": "solarterms" 1762 | }, 1763 | "2024-08-15 00:00:00": { 1764 | "name": "광복절", 1765 | "type": "holiday" 1766 | }, 1767 | "2024-08-23 00:00:00": { 1768 | "name": "처서", 1769 | "type": "solarterms" 1770 | }, 1771 | "2024-09-07 00:00:00": { 1772 | "name": "백로", 1773 | "type": "solarterms" 1774 | }, 1775 | "2024-09-16 00:00:00": { 1776 | "name": "추석", 1777 | "type": "consecutive" 1778 | }, 1779 | "2024-09-17 00:00:00": { 1780 | "name": "추석", 1781 | "type": "holiday" 1782 | }, 1783 | "2024-09-18 00:00:00": { 1784 | "name": "추석", 1785 | "type": "consecutive" 1786 | }, 1787 | "2024-09-22 00:00:00": { 1788 | "name": "추분", 1789 | "type": "solarterms" 1790 | }, 1791 | "2024-10-03 00:00:00": { 1792 | "name": "개천절", 1793 | "type": "holiday" 1794 | }, 1795 | "2024-10-08 00:00:00": { 1796 | "name": "한로", 1797 | "type": "solarterms" 1798 | }, 1799 | "2024-10-09 00:00:00": { 1800 | "name": "한글날", 1801 | "type": "holiday" 1802 | }, 1803 | "2024-10-23 00:00:00": { 1804 | "name": "상강", 1805 | "type": "solarterms" 1806 | }, 1807 | "2024-11-07 00:00:00": { 1808 | "name": "입동", 1809 | "type": "solarterms" 1810 | }, 1811 | "2024-11-22 00:00:00": { 1812 | "name": "소설", 1813 | "type": "solarterms" 1814 | }, 1815 | "2024-12-07 00:00:00": { 1816 | "name": "대설", 1817 | "type": "solarterms" 1818 | }, 1819 | "2024-12-21 00:00:00": { 1820 | "name": "동지", 1821 | "type": "solarterms" 1822 | }, 1823 | "2024-12-25 00:00:00": { 1824 | "name": "성탄절", 1825 | "type": "holiday" 1826 | }, 1827 | "2025-01-01 00:00:00": { 1828 | "name": "새해 첫날", 1829 | "type": "holiday" 1830 | }, 1831 | "2025-01-05 00:00:00": { 1832 | "name": "소한", 1833 | "type": "solarterms" 1834 | }, 1835 | "2025-01-20 00:00:00": { 1836 | "name": "대한", 1837 | "type": "solarterms" 1838 | }, 1839 | "2025-01-28 00:00:00": { 1840 | "name": "설날", 1841 | "type": "consecutive" 1842 | }, 1843 | "2025-01-29 00:00:00": { 1844 | "name": "설날", 1845 | "type": "holiday" 1846 | }, 1847 | "2025-01-30 00:00:00": { 1848 | "name": "설날", 1849 | "type": "consecutive" 1850 | }, 1851 | "2025-02-03 00:00:00": { 1852 | "name": "입춘", 1853 | "type": "solarterms" 1854 | }, 1855 | "2025-02-12 00:00:00": { 1856 | "name": "정월 대보름", 1857 | "type": "solarterms" 1858 | }, 1859 | "2025-02-14 00:00:00": { 1860 | "name": "밸런타인데이", 1861 | "type": "etc" 1862 | }, 1863 | "2025-02-18 00:00:00": { 1864 | "name": "우수", 1865 | "type": "solarterms" 1866 | }, 1867 | "2025-03-01 00:00:00": { 1868 | "name": "삼일절", 1869 | "type": "holiday" 1870 | }, 1871 | "2025-03-05 00:00:00": { 1872 | "name": "경칩", 1873 | "type": "solarterms" 1874 | }, 1875 | "2025-03-14 00:00:00": { 1876 | "name": "화이트데이", 1877 | "type": "etc" 1878 | }, 1879 | "2025-03-20 00:00:00": { 1880 | "name": "춘분", 1881 | "type": "solarterms" 1882 | }, 1883 | "2025-04-04 00:00:00": { 1884 | "name": "청명", 1885 | "type": "solarterms" 1886 | }, 1887 | "2025-04-05 00:00:00": { 1888 | "name": "한식", 1889 | "type": "solarterms" 1890 | }, 1891 | "2025-04-20 00:00:00": { 1892 | "name": "곡우", 1893 | "type": "solarterms" 1894 | }, 1895 | "2025-05-01 00:00:00": { 1896 | "name": "근로자의날", 1897 | "type": "national" 1898 | }, 1899 | "2025-05-05 00:00:00": { 1900 | "name": "입하", 1901 | "type": "solarterms" 1902 | }, 1903 | "2025-05-08 00:00:00": { 1904 | "name": "어버이날", 1905 | "type": "national" 1906 | }, 1907 | "2025-05-10 00:00:00": { 1908 | "name": "유권자의날", 1909 | "type": "national" 1910 | }, 1911 | "2025-05-15 00:00:00": { 1912 | "name": "스승의날", 1913 | "type": "national" 1914 | }, 1915 | "2025-05-21 00:00:00": { 1916 | "name": "소만", 1917 | "type": "solarterms" 1918 | }, 1919 | "2025-05-31 00:00:00": { 1920 | "name": "단오", 1921 | "type": "solarterms" 1922 | }, 1923 | "2025-06-05 00:00:00": { 1924 | "name": "망종", 1925 | "type": "solarterms" 1926 | }, 1927 | "2025-06-06 00:00:00": { 1928 | "name": "현충일", 1929 | "type": "holiday" 1930 | }, 1931 | "2025-06-21 00:00:00": { 1932 | "name": "하지", 1933 | "type": "solarterms" 1934 | }, 1935 | "2025-06-25 00:00:00": { 1936 | "name": "6.25 한국 전쟁", 1937 | "type": "national" 1938 | }, 1939 | "2025-07-07 00:00:00": { 1940 | "name": "소서", 1941 | "type": "solarterms" 1942 | }, 1943 | "2025-07-17 00:00:00": { 1944 | "name": "제헌절", 1945 | "type": "national" 1946 | }, 1947 | "2025-07-20 00:00:00": { 1948 | "name": "초복", 1949 | "type": "solarterms" 1950 | }, 1951 | "2025-07-22 00:00:00": { 1952 | "name": "대서", 1953 | "type": "solarterms" 1954 | }, 1955 | "2025-07-30 00:00:00": { 1956 | "name": "중복", 1957 | "type": "solarterms" 1958 | }, 1959 | "2025-08-07 00:00:00": { 1960 | "name": "입추", 1961 | "type": "solarterms" 1962 | }, 1963 | "2025-08-09 00:00:00": { 1964 | "name": "말복", 1965 | "type": "solarterms" 1966 | }, 1967 | "2025-08-15 00:00:00": { 1968 | "name": "광복절", 1969 | "type": "holiday" 1970 | }, 1971 | "2025-08-23 00:00:00": { 1972 | "name": "처서", 1973 | "type": "solarterms" 1974 | }, 1975 | "2025-09-07 00:00:00": { 1976 | "name": "백로", 1977 | "type": "solarterms" 1978 | }, 1979 | "2025-09-23 00:00:00": { 1980 | "name": "추분", 1981 | "type": "solarterms" 1982 | }, 1983 | "2025-10-03 00:00:00": { 1984 | "name": "개천절", 1985 | "type": "holiday" 1986 | }, 1987 | "2025-10-05 00:00:00": { 1988 | "name": "추석", 1989 | "type": "consecutive" 1990 | }, 1991 | "2025-10-06 00:00:00": { 1992 | "name": "추석", 1993 | "type": "holiday" 1994 | }, 1995 | "2025-10-07 00:00:00": { 1996 | "name": "추석", 1997 | "type": "consecutive" 1998 | }, 1999 | "2025-10-08 00:00:00": { 2000 | "name": "한로", 2001 | "type": "solarterms" 2002 | }, 2003 | "2025-10-09 00:00:00": { 2004 | "name": "한글날", 2005 | "type": "holiday" 2006 | }, 2007 | "2025-10-23 00:00:00": { 2008 | "name": "상강", 2009 | "type": "solarterms" 2010 | }, 2011 | "2025-11-07 00:00:00": { 2012 | "name": "입동", 2013 | "type": "solarterms" 2014 | }, 2015 | "2025-11-22 00:00:00": { 2016 | "name": "소설", 2017 | "type": "solarterms" 2018 | }, 2019 | "2025-12-07 00:00:00": { 2020 | "name": "대설", 2021 | "type": "solarterms" 2022 | }, 2023 | "2025-12-21 00:00:00": { 2024 | "name": "동지", 2025 | "type": "solarterms" 2026 | }, 2027 | "2025-12-25 00:00:00": { 2028 | "name": "성탄절", 2029 | "type": "holiday" 2030 | }, 2031 | "2026-01-01 00:00:00": { 2032 | "name": "새해 첫날", 2033 | "type": "holiday" 2034 | }, 2035 | "2026-01-05 00:00:00": { 2036 | "name": "소한", 2037 | "type": "solarterms" 2038 | }, 2039 | "2026-01-20 00:00:00": { 2040 | "name": "대한", 2041 | "type": "solarterms" 2042 | }, 2043 | "2026-02-04 00:00:00": { 2044 | "name": "입춘", 2045 | "type": "solarterms" 2046 | }, 2047 | "2026-02-14 00:00:00": { 2048 | "name": "밸런타인데이", 2049 | "type": "etc" 2050 | }, 2051 | "2026-02-16 00:00:00": { 2052 | "name": "설날", 2053 | "type": "consecutive" 2054 | }, 2055 | "2026-02-17 00:00:00": { 2056 | "name": "설날", 2057 | "type": "holiday" 2058 | }, 2059 | "2026-02-18 00:00:00": { 2060 | "name": "설날", 2061 | "type": "consecutive" 2062 | }, 2063 | "2026-02-19 00:00:00": { 2064 | "name": "우수", 2065 | "type": "solarterms" 2066 | }, 2067 | "2026-03-01 00:00:00": { 2068 | "name": "삼일절", 2069 | "type": "holiday" 2070 | } 2071 | }; 2072 | return { 2073 | load: function(mindate, maxdate, url) { 2074 | if (loadHolidaySuccess) { 2075 | return; 2076 | } 2077 | if (url) { 2078 | return $http({ 2079 | method: 'GET', 2080 | url: url, 2081 | params: { 2082 | startDate: $filter('date')(mindate, 'yyyy-MM-dd'), 2083 | endDate: $filter('date')(maxdate, 'yyyy-MM-dd') 2084 | } 2085 | }).then(function(o) { 2086 | loadHolidaySuccess = true; 2087 | return holidays = o.data; 2088 | }); 2089 | } 2090 | }, 2091 | isHoliday: function(date) { 2092 | var dateString; 2093 | if (date && holidays) { 2094 | dateString = $filter('date')(date, 'yyyy-MM-dd 00:00:00'); 2095 | if (holidays[dateString] && (holidays[dateString].type === 'holiday' || holidays[dateString].type === 'consecutive')) { 2096 | return true; 2097 | } 2098 | } 2099 | return false; 2100 | }, 2101 | getToday: function() { 2102 | return todayDate; 2103 | }, 2104 | setToday: function(d) { 2105 | return todayDate = d; 2106 | }, 2107 | setHoliday: function(h) { 2108 | holidays = h; 2109 | return loadHolidaySuccess = true; 2110 | } 2111 | }; 2112 | } 2113 | ]); 2114 | 2115 | }).call(this); 2116 | 2117 | (function() { 2118 | 'use strict'; 2119 | var app; 2120 | 2121 | app = angular.module('datePeriodPicker'); 2122 | 2123 | app.controller('DatepickerModalController', [ 2124 | '$scope', 'close', 'start', 'end', 'buttonName', 'callback', 'options', function($scope, close, start, end, buttonName, callback, options) { 2125 | if (start != null) { 2126 | $scope.start = new Date(start.getTime()); 2127 | } 2128 | if (end != null) { 2129 | $scope.end = new Date(end.getTime()); 2130 | } 2131 | if (buttonName != null) { 2132 | $scope.buttonName = buttonName; 2133 | } 2134 | if (callback != null) { 2135 | $scope.callback = callback; 2136 | } 2137 | $scope.options = options; 2138 | $scope.close = function() { 2139 | $scope.callback('close'); 2140 | if (options.project === 'flights') { 2141 | return close({ 2142 | trip: $scope.options.trip, 2143 | sdate0: $scope.options.sdate0, 2144 | sdate1: $scope.options.sdate1, 2145 | sdate2: $scope.options.sdate2 2146 | }); 2147 | } else { 2148 | return close({ 2149 | start: $scope.start, 2150 | end: $scope.end 2151 | }); 2152 | } 2153 | }; 2154 | if (!options.display) { 2155 | close(null, 200); 2156 | } 2157 | return $scope.$on('$locationChangeStart', function(event, next, current) { 2158 | if (options.display === 1) { 2159 | $scope.callback('close'); 2160 | return close(); 2161 | } 2162 | }); 2163 | } 2164 | ]); 2165 | 2166 | }).call(this); 2167 | 2168 | (function() { 2169 | 'use strict'; 2170 | var app; 2171 | 2172 | app = angular.module('datePeriodPicker'); 2173 | 2174 | app.service('DatepickerModalService', [ 2175 | 'ModalService', '$q', function(ModalService, $q) { 2176 | return { 2177 | preload: function(start, end, options) { 2178 | options.display = 0; 2179 | return ModalService.showModal({ 2180 | templateUrl: 'release/datepicker-modal.html', 2181 | controller: 'DatepickerModalController', 2182 | inputs: { 2183 | start: start, 2184 | end: end, 2185 | buttonName: null, 2186 | callback: null, 2187 | options: options 2188 | } 2189 | }); 2190 | }, 2191 | showModal: function(start, end, buttonName, callback, options) { 2192 | var deferred; 2193 | options.display = 1; 2194 | deferred = $q.defer(); 2195 | ModalService.showModal({ 2196 | templateUrl: 'release/datepicker-modal.html', 2197 | controller: 'DatepickerModalController', 2198 | inputs: { 2199 | start: start, 2200 | end: end, 2201 | buttonName: buttonName, 2202 | callback: callback, 2203 | options: options 2204 | } 2205 | }).then(function(modal) { 2206 | return modal.close.then(function(result) { 2207 | if (result) { 2208 | return deferred.resolve(result); 2209 | } else { 2210 | return deferred.reject(); 2211 | } 2212 | }); 2213 | }); 2214 | return deferred.promise; 2215 | }, 2216 | show: function(start, end, callback, options) { 2217 | return this.showModal(start, end, null, callback, options); 2218 | }, 2219 | checkin: function(start, end, options) { 2220 | return this.showModal(start, end, 'checkin', callback, options); 2221 | }, 2222 | checkout: function(start, end, options) { 2223 | return this.showModal(start, end, 'checkout', callback, options); 2224 | } 2225 | }; 2226 | } 2227 | ]); 2228 | 2229 | }).call(this); 2230 | 2231 | (function() { 2232 | 'use strict'; 2233 | var app; 2234 | 2235 | app = angular.module('datePeriodPicker'); 2236 | 2237 | app.directive('mgDatepicker', [ 2238 | '$timeout', '$filter', function($timeout, $filter) { 2239 | return { 2240 | restrict: 'AE', 2241 | replace: true, 2242 | scope: { 2243 | mgOptions: '=', 2244 | mgStart: '=', 2245 | mgEnd: '=', 2246 | mgButtonName: '=', 2247 | mgCallback: '=', 2248 | mgSelect: '&' 2249 | }, 2250 | templateUrl: function(tElement, tAttrs) { 2251 | return "release/mg-datepicker.html"; 2252 | }, 2253 | link: function(scope, element, attrs) { 2254 | var id, monthDate, monthElement; 2255 | if (scope.mgOptions.project === 'flights') { 2256 | id = null; 2257 | monthElement = null; 2258 | monthDate = null; 2259 | if (scope.mgOptions.openButton === 'sdate0') { 2260 | monthDate = scope.mgOptions.sdate0; 2261 | } else if (scope.mgOptions.openButton === 'sdate1') { 2262 | monthDate = scope.mgOptions.sdate1; 2263 | } else if (scope.mgOptions.openButton === 'sdate2') { 2264 | monthDate = scope.mgOptions.sdate2; 2265 | } 2266 | if (monthDate !== null) { 2267 | id = $filter('date')(monthDate, 'yyyy.MM'); 2268 | monthElement = angular.element(document.getElementById(id)); 2269 | element.parent()[0].scrollTop = monthElement[0].offsetTop; 2270 | } 2271 | return; 2272 | } 2273 | if (scope.mgStart == null) { 2274 | return; 2275 | } 2276 | return $timeout(function() { 2277 | id = $filter('date')(scope.mgStart, 'yyyy.MM'); 2278 | monthElement = angular.element(document.getElementById(id)); 2279 | return element.parent()[0].scrollTop = monthElement[0].offsetTop; 2280 | }); 2281 | }, 2282 | controller: [ 2283 | '$scope', 'ModalService', 'Calendar', '$compile', function(scope, ModalService, Calendar, compile) { 2284 | var activate, date, drawCalendar, drawCheckInCheckOut, drawEndDate, drawSelectedFlight, drawStartDate, getMonthHtml, months, nEnabledTimeLength, ref, ref1, ref2, removeCheckInOut, removeCheckOut, startSelected, weeksInMonth; 2285 | if (!scope.mgOptions.checkInString) { 2286 | scope.mgOptions.checkInString = 'check in'; 2287 | } 2288 | if (!scope.mgOptions.checkOutString) { 2289 | scope.mgOptions.checkOutString = 'check out'; 2290 | } 2291 | scope.weekdays = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']; 2292 | startSelected = false; 2293 | if (scope.mgOptions.mgPenTodaysDeal || (scope.mgStart && scope.mgButtonName === 'checkout')) { 2294 | startSelected = true; 2295 | } 2296 | scope.restrictions = { 2297 | mindate: new Date(), 2298 | maxdate: new Date() 2299 | }; 2300 | if (((ref = scope.mgOptions) != null ? ref.selectableDays : void 0) != null) { 2301 | nEnabledTimeLength = (1000 * 60 * 60 * 24) * (scope.mgOptions.selectableDays - 1); 2302 | scope.restrictions.maxdate.setTime(scope.restrictions.maxdate.getTime() + nEnabledTimeLength); 2303 | } else { 2304 | scope.restrictions.maxdate.setMonth(scope.restrictions.mindate.getMonth() + 12); 2305 | } 2306 | if (((ref1 = scope.mgOptions) != null ? ref1.mindate : void 0) != null) { 2307 | scope.restrictions.mindate = new Date(scope.mgOptions.mindate); 2308 | } 2309 | if (((ref2 = scope.mgOptions) != null ? ref2.maxdate : void 0) != null) { 2310 | scope.restrictions.maxdate = new Date(scope.mgOptions.maxdate); 2311 | } else { 2312 | 2313 | } 2314 | scope.restrictions.mindate.setHours(0, 0, 0, 0); 2315 | scope.restrictions.maxdate.setHours(23, 59, 59, 999); 2316 | months = []; 2317 | date = new Date(scope.restrictions.mindate.getTime()); 2318 | date.setHours(0, 0, 0, 0); 2319 | date.setDate(1); 2320 | while (date <= scope.restrictions.maxdate) { 2321 | months.push(new Date(date.getTime())); 2322 | date.setMonth(date.getMonth() + 1); 2323 | } 2324 | weeksInMonth = function(month) { 2325 | var day, each, j, newDay, ref3, week, weeks; 2326 | weeks = []; 2327 | day = new Date(month); 2328 | while (day.getMonth() === month.getMonth()) { 2329 | newDay = new Date(day); 2330 | if (!week) { 2331 | week = []; 2332 | for (each = j = 1, ref3 = day.getDay(); j <= ref3; each = j += 1) { 2333 | week.push(null); 2334 | } 2335 | } 2336 | if (day.getDay() === 6 || (new Date(day.getYear(), day.getMonth() + 1, 0)).getDate() === day.getDate()) { 2337 | week.push(newDay); 2338 | weeks.push(week); 2339 | week = []; 2340 | } else { 2341 | week.push(newDay); 2342 | } 2343 | day.setDate(day.getDate() + 1); 2344 | } 2345 | return weeks; 2346 | }; 2347 | activate = function() { 2348 | var arrayMonths, j, len, monthStart; 2349 | scope.dates = []; 2350 | arrayMonths = []; 2351 | for (j = 0, len = months.length; j < len; j++) { 2352 | monthStart = months[j]; 2353 | arrayMonths.push({ 2354 | monthText: $filter('date')(monthStart, 'yyyy.MM'), 2355 | weeks: weeksInMonth(monthStart) 2356 | }); 2357 | } 2358 | return drawCalendar(arrayMonths); 2359 | }; 2360 | drawCalendar = function(arrayMonths) { 2361 | var calendarHtml, elCompile, elCon, elCustom, j, len, month, welCon; 2362 | calendarHtml = ''; 2363 | for (j = 0, len = arrayMonths.length; j < len; j++) { 2364 | month = arrayMonths[j]; 2365 | calendarHtml += getMonthHtml(month); 2366 | } 2367 | elCustom = document.getElementById('custom-modal'); 2368 | elCon = elCustom.querySelector('.datepicker'); 2369 | welCon = angular.element(elCon); 2370 | elCompile = compile(calendarHtml)(scope); 2371 | welCon.html(''); 2372 | return welCon.append(elCompile); 2373 | }; 2374 | getMonthHtml = function(obj) { 2375 | var addStr, dateArr, dateObj, j, k, len, len1, monthText, numClass, str, week, weeks; 2376 | weeks = obj.weeks; 2377 | monthText = obj.monthText; 2378 | str = ''; 2379 | str += '
'; 2380 | str += '
' + monthText + '
'; 2381 | str += ''; 2382 | str += ''; 2383 | str += ''; 2384 | for (j = 0, len = weeks.length; j < len; j++) { 2385 | week = weeks[j]; 2386 | dateArr = week; 2387 | str += ''; 2388 | for (k = 0, len1 = dateArr.length; k < len1; k++) { 2389 | dateObj = dateArr[k]; 2390 | if (dateObj === null) { 2391 | str += ''; 2392 | } else { 2393 | numClass = scope.calendar["class"](dateObj); 2394 | str += ''; 2429 | } 2430 | } 2431 | str += ''; 2432 | } 2433 | str += '
SUNMONTUEWEDTHUFRISAT
'; 2395 | str += '
'; 2396 | str += '
' + dateObj.getDate() + '
'; 2397 | if (scope.mgOptions.project === 'flights') { 2398 | addStr = ''; 2399 | if (scope.mgOptions.trip === 'rt' && scope.calendar.isRoundTripSameDate(dateObj)) { 2400 | addStr = '
당일
'; 2401 | } else { 2402 | if (numClass.indexOf('today') !== -1) { 2403 | addStr = '
오늘
'; 2404 | } else { 2405 | if (scope.calendar.isSdate0(dateObj)) { 2406 | addStr += '
' + scope.mgOptions.sdate0String + '
'; 2407 | } 2408 | if (scope.calendar.isSdate1(dateObj)) { 2409 | addStr += '
' + scope.mgOptions.sdate1String + '
'; 2410 | } 2411 | if (scope.calendar.isSdate2(dateObj)) { 2412 | addStr += '
' + scope.mgOptions.sdate2String + '
'; 2413 | } 2414 | } 2415 | } 2416 | str += addStr; 2417 | } else { 2418 | if (numClass.indexOf('today') !== -1) { 2419 | str += '
오늘
'; 2420 | } 2421 | if (scope.calendar.isStart(dateObj)) { 2422 | str += '
' + scope.mgOptions.checkInString + '
'; 2423 | } 2424 | if (scope.calendar.isEnd(dateObj)) { 2425 | str += '
' + scope.mgOptions.checkOutString + '
'; 2426 | } 2427 | } 2428 | str += '
'; 2434 | return str; 2435 | }; 2436 | drawCheckInCheckOut = function() { 2437 | var beDate, elTd; 2438 | if (scope.mgOptions.limitNights !== null) { 2439 | activate(); 2440 | return; 2441 | } 2442 | if (scope.mgStart !== null) { 2443 | drawStartDate(scope.mgStart, scope.mgStart.getFullYear(), scope.mgStart.getMonth() + 1, scope.mgStart.getDate()); 2444 | } 2445 | if (scope.mgEnd !== null) { 2446 | drawEndDate(scope.mgEnd, scope.mgEnd.getFullYear(), scope.mgEnd.getMonth() + 1, scope.mgEnd.getDate()); 2447 | } 2448 | if (scope.mgStart !== null && scope.mgEnd !== null) { 2449 | beDate = new Date(scope.mgStart.getFullYear(), scope.mgStart.getMonth(), scope.mgStart.getDate()); 2450 | beDate.setDate(beDate.getDate() + 1); 2451 | while (beDate < scope.mgEnd) { 2452 | elTd = document.getElementById($filter('date')(beDate, 'yyyyMd')); 2453 | angular.element(elTd).addClass('between-selected'); 2454 | beDate.setDate(beDate.getDate() + 1); 2455 | } 2456 | } 2457 | }; 2458 | drawStartDate = function(date, nYear, nMonth, nDate) { 2459 | var cell, elCustom, elToday, elTodayStr, td, todayId; 2460 | td = document.getElementById(nYear + '' + nMonth + '' + nDate); 2461 | angular.element(td).addClass('selected'); 2462 | cell = td.querySelector('.cell'); 2463 | angular.element(cell).append('
' + scope.mgOptions.checkInString + '
'); 2464 | elCustom = document.getElementById('custom-modal'); 2465 | if (scope.calendar.isToday(date)) { 2466 | elTodayStr = elCustom.querySelector('.txtToday'); 2467 | if (typeof elTodayStr !== 'undefined') { 2468 | angular.element(elTodayStr).remove(); 2469 | } 2470 | elToday = elCustom.querySelector('.today'); 2471 | if (typeof elToday !== 'undefined') { 2472 | return angular.element(elToday).removeClass('today'); 2473 | } 2474 | } else { 2475 | todayId = $filter('date')(Calendar.getToday(), 'yyyyMd'); 2476 | td = document.getElementById(todayId); 2477 | if (td.querySelector('.txtToday') === null) { 2478 | angular.element(td).addClass('today'); 2479 | return angular.element(td.querySelector('.cell')).append('
오늘
'); 2480 | } 2481 | } 2482 | }; 2483 | drawEndDate = function(date, nYear, nMonth, nDate) { 2484 | var cell, td; 2485 | td = document.getElementById(nYear + '' + nMonth + '' + nDate); 2486 | angular.element(td).addClass('selected'); 2487 | cell = td.querySelector('.cell'); 2488 | return angular.element(cell).append('
' + scope.mgOptions.checkOutString + '
'); 2489 | }; 2490 | removeCheckOut = function() { 2491 | var arrBetween, arrSelect, checkoutSelected, elBetween, elCheckOut, elCustom, j, len, results; 2492 | elCustom = document.getElementById('custom-modal'); 2493 | elCheckOut = elCustom.querySelector('.txtCheckOut'); 2494 | if (typeof elCheckOut !== 'undefined') { 2495 | angular.element(elCheckOut).remove(); 2496 | } 2497 | arrSelect = elCustom.querySelectorAll('.selected'); 2498 | if (0 < arrSelect.length) { 2499 | checkoutSelected = arrSelect[arrSelect.length - 1]; 2500 | angular.element(checkoutSelected).removeClass('selected'); 2501 | } 2502 | arrBetween = elCustom.querySelectorAll('.between-selected'); 2503 | results = []; 2504 | for (j = 0, len = arrBetween.length; j < len; j++) { 2505 | elBetween = arrBetween[j]; 2506 | results.push(angular.element(elBetween).removeClass('between-selected')); 2507 | } 2508 | return results; 2509 | }; 2510 | removeCheckInOut = function() { 2511 | var arrBetween, arrSelect, elBetween, elCheckIn, elCheckOut, elCustom, elSelect, j, k, len, len1, results; 2512 | elCustom = document.getElementById('custom-modal'); 2513 | elCheckIn = elCustom.querySelector('.txtCheckIn'); 2514 | if (typeof elCheckIn !== 'undefined') { 2515 | angular.element(elCheckIn).remove(); 2516 | } 2517 | elCheckOut = elCustom.querySelector('.txtCheckOut'); 2518 | if (typeof elCheckOut !== 'undefined') { 2519 | angular.element(elCheckOut).remove(); 2520 | } 2521 | arrSelect = elCustom.querySelectorAll('.selected'); 2522 | for (j = 0, len = arrSelect.length; j < len; j++) { 2523 | elSelect = arrSelect[j]; 2524 | angular.element(elSelect).removeClass('selected'); 2525 | } 2526 | arrBetween = elCustom.querySelectorAll('.between-selected'); 2527 | results = []; 2528 | for (k = 0, len1 = arrBetween.length; k < len1; k++) { 2529 | elBetween = arrBetween[k]; 2530 | results.push(angular.element(elBetween).removeClass('between-selected')); 2531 | } 2532 | return results; 2533 | }; 2534 | drawSelectedFlight = function() { 2535 | var betweenArr, betweenDate, cell, elCalendar, elSdate0, elSdate1, elSdate2, i, options, sameDate, selectedArr, td, today; 2536 | options = scope.mgOptions; 2537 | elCalendar = document.getElementById('custom-modal'); 2538 | today = new Date(Calendar.getToday().getTime()).setHours(0, 0, 0, 0); 2539 | if (options.sdate0 !== null && options.sdate0.getTime() === today || options.sdate1 !== null && options.sdate1.getTime() === today || options.sdate2 !== null && options.sdate2.getTime() === today) { 2540 | angular.element(elCalendar.querySelector('.today')).removeClass('today'); 2541 | angular.element(elCalendar.querySelector('.txtToday')).remove(); 2542 | } 2543 | sameDate = elCalendar.querySelector('.txtSame'); 2544 | if (sameDate !== null) { 2545 | angular.element(sameDate).remove(); 2546 | } 2547 | elSdate0 = elCalendar.querySelector('.txtSdate0'); 2548 | if (elSdate0 !== null) { 2549 | angular.element(elSdate0).remove(); 2550 | } 2551 | elSdate1 = elCalendar.querySelector('.txtSdate1'); 2552 | if (elSdate1 !== null) { 2553 | angular.element(elSdate1).remove(); 2554 | } 2555 | elSdate2 = elCalendar.querySelector('.txtSdate2'); 2556 | if (elSdate2 !== null) { 2557 | angular.element(elSdate2).remove(); 2558 | } 2559 | selectedArr = elCalendar.querySelectorAll('.selected'); 2560 | i = 0; 2561 | while (i < selectedArr.length) { 2562 | angular.element(selectedArr[i]).removeClass('selected'); 2563 | i++; 2564 | } 2565 | betweenArr = elCalendar.querySelectorAll('.between-selected'); 2566 | i = 0; 2567 | while (i < betweenArr.length) { 2568 | angular.element(betweenArr[i]).removeClass('between-selected'); 2569 | i++; 2570 | } 2571 | if (options.trip === 'rt' && options.sdate0 !== null && options.sdate1 !== null && options.sdate0.getTime() === options.sdate1.getTime()) { 2572 | td = document.getElementById($filter('date')(options.sdate0, 'yyyyMd')); 2573 | angular.element(td).addClass('selected'); 2574 | cell = td.querySelector('.cell'); 2575 | angular.element(cell).append('
당일
'); 2576 | } else { 2577 | if (options.sdate0 !== null) { 2578 | td = document.getElementById($filter('date')(options.sdate0, 'yyyyMd')); 2579 | angular.element(td).addClass('selected'); 2580 | cell = td.querySelector('.cell'); 2581 | angular.element(cell).append('
' + scope.mgOptions.sdate0String + '
'); 2582 | } 2583 | if (options.sdate1 !== null) { 2584 | td = document.getElementById($filter('date')(options.sdate1, 'yyyyMd')); 2585 | angular.element(td).addClass('selected'); 2586 | cell = td.querySelector('.cell'); 2587 | angular.element(cell).append('
' + scope.mgOptions.sdate1String + '
'); 2588 | } 2589 | if (options.sdate2 !== null) { 2590 | td = document.getElementById($filter('date')(options.sdate2, 'yyyyMd')); 2591 | angular.element(td).addClass('selected'); 2592 | cell = td.querySelector('.cell'); 2593 | angular.element(cell).append('
' + scope.mgOptions.sdate2String + '
'); 2594 | } 2595 | if (options.sdate0 !== null && options.sdate1 !== null && options.sdate0.getTime() !== options.sdate1.getTime()) { 2596 | betweenDate = new Date(options.sdate0.getTime()); 2597 | betweenDate.setDate(betweenDate.getDate() + 1); 2598 | while (betweenDate.getTime() < options.sdate1.getTime()) { 2599 | td = document.getElementById($filter('date')(betweenDate, 'yyyyMd')); 2600 | angular.element(td).addClass('between-selected'); 2601 | betweenDate.setDate(betweenDate.getDate() + 1); 2602 | } 2603 | } 2604 | if (options.sdate1 !== null && options.sdate2 !== null && options.sdate1.getTime() !== options.sdate2.getTime()) { 2605 | betweenDate = new Date(options.sdate1.getTime()); 2606 | betweenDate.setDate(betweenDate.getDate() + 1); 2607 | while (betweenDate.getTime() < options.sdate2.getTime()) { 2608 | td = document.getElementById($filter('date')(betweenDate, 'yyyyMd')); 2609 | angular.element(td).addClass('between-selected'); 2610 | betweenDate.setDate(betweenDate.getDate() + 1); 2611 | } 2612 | } 2613 | if (options.sdate0 !== null && options.sdate1 === null && options.sdate2 !== null && options.sdate0.getTime() !== options.sdate2.getTime()) { 2614 | betweenDate = new Date(options.sdate0.getTime()); 2615 | betweenDate.setDate(betweenDate.getDate() + 1); 2616 | while (betweenDate.getTime() < options.sdate2.getTime()) { 2617 | td = document.getElementById($filter('date')(betweenDate, 'yyyyMd')); 2618 | angular.element(td).addClass('between-selected'); 2619 | betweenDate.setDate(betweenDate.getDate() + 1); 2620 | } 2621 | } 2622 | } 2623 | }; 2624 | if (scope.mgOptions.enableKoreanCalendar) { 2625 | Calendar.load(scope.restrictions.mindate, scope.restrictions.maxdate, scope.mgOptions.holidayUrl); 2626 | } 2627 | scope.calendar = { 2628 | offsetMargin: function(date) { 2629 | return new Date(date.getFullYear(), date.getMonth()).getDay() * 2.75 + 'rem'; 2630 | }, 2631 | isVisible: function(date, day) { 2632 | return new Date(date.getFullYear(), date.getMonth(), day).getMonth() === date.getMonth(); 2633 | }, 2634 | isDisabled: function(currentDate) { 2635 | var maxdate, mindate; 2636 | mindate = scope.restrictions.mindate; 2637 | if ((scope.mgOptions.limitNights != null) && startSelected) { 2638 | maxdate = new Date(scope.mgStart.getFullYear(), scope.mgStart.getMonth(), scope.mgStart.getDate() + scope.mgOptions.limitNights); 2639 | if (maxdate > scope.restrictions.maxdate) { 2640 | maxdate = scope.restrictions.maxdate; 2641 | } 2642 | } else { 2643 | maxdate = scope.restrictions.maxdate; 2644 | } 2645 | return ((mindate != null) && currentDate < mindate) || ((maxdate != null) && currentDate > maxdate); 2646 | }, 2647 | isToday: function(day) { 2648 | return day.toDateString() === Calendar.getToday().toDateString(); 2649 | }, 2650 | isStart: function(day) { 2651 | return (scope.mgStart != null) && scope.mgStart.getTime() === day.getTime(); 2652 | }, 2653 | isEnd: function(day) { 2654 | return (scope.mgEnd != null) && scope.mgEnd.getTime() === day.getTime(); 2655 | }, 2656 | isSdate0: function(day) { 2657 | return scope.mgOptions.sdate0 !== null && scope.mgOptions.sdate0.getTime() === day.getTime(); 2658 | }, 2659 | isSdate1: function(day) { 2660 | return scope.mgOptions.sdate1 !== null && scope.mgOptions.sdate1.getTime() === day.getTime(); 2661 | }, 2662 | isSdate2: function(day) { 2663 | return scope.mgOptions.sdate2 !== null && scope.mgOptions.sdate2.getTime() === day.getTime(); 2664 | }, 2665 | isRoundTripSameDate: function(day) { 2666 | if (scope.mgOptions.sdate0 !== null && scope.mgOptions.sdate1 !== null) { 2667 | return scope.mgOptions.sdate0.getTime() === day.getTime() && scope.mgOptions.sdate1.getTime() === day.getTime(); 2668 | } 2669 | }, 2670 | "class": function(day) { 2671 | var classString, dayObj, options; 2672 | classString = ''; 2673 | dayObj = new Date(day); 2674 | if (this.isDisabled(dayObj)) { 2675 | classString = 'disabled'; 2676 | } else if (scope.mgOptions.enableKoreanCalendar && Calendar.isHoliday(dayObj)) { 2677 | classString = 'holiday'; 2678 | } else { 2679 | if (dayObj.getDay() === 0) { 2680 | classString = 'sunday'; 2681 | } else if (dayObj.getDay() === 6) { 2682 | classString = 'saturday'; 2683 | } 2684 | } 2685 | if (scope.mgOptions.project === 'flights') { 2686 | options = scope.mgOptions; 2687 | if (options.sdate0 !== null && options.sdate0.getTime() === dayObj.getTime()) { 2688 | classString += ' selected'; 2689 | } else if (options.sdate1 !== null && options.sdate1.getTime() === dayObj.getTime()) { 2690 | classString += ' selected'; 2691 | } else if (options.sdate2 !== null && options.sdate2.getTime() === dayObj.getTime()) { 2692 | classString += ' selected'; 2693 | } else if (options.sdate0 !== null && options.sdate1 !== null && dayObj > options.sdate0 && dayObj < options.sdate1) { 2694 | classString = 'between-selected'; 2695 | } else if (options.sdate1 !== null && options.sdate2 !== null && dayObj > options.sdate1 && dayObj < options.sdate2) { 2696 | classString = 'between-selected'; 2697 | } else if (dayObj.getTime() === new Date().setHours(0, 0, 0, 0)) { 2698 | classString = 'today'; 2699 | } 2700 | } else { 2701 | if ((scope.mgStart != null) && scope.mgStart.getTime() === dayObj.getTime()) { 2702 | classString += ' selected'; 2703 | } else if ((scope.mgEnd != null) && scope.mgEnd.getTime() === dayObj.getTime()) { 2704 | classString += ' selected'; 2705 | } else if ((scope.mgStart != null) && (scope.mgEnd != null) && dayObj > scope.mgStart && dayObj < scope.mgEnd) { 2706 | classString = 'between-selected'; 2707 | } else if (scope.mgOptions.today != null) { 2708 | if (dayObj.getTime() === scope.mgOptions.today.setHours(0, 0, 0, 0)) { 2709 | classString = 'today'; 2710 | } 2711 | } else if (dayObj.getTime() === new Date().setHours(0, 0, 0, 0)) { 2712 | classString = 'today'; 2713 | } 2714 | } 2715 | return classString; 2716 | }, 2717 | startDayText: function() { 2718 | if (scope.mgOptions.startDateText) { 2719 | return scope.startDateText; 2720 | } 2721 | }, 2722 | endDayText: function() { 2723 | if (scope.mgOptions.endDateText) { 2724 | return scope.endDateText; 2725 | } 2726 | }, 2727 | select: function(isDisabled, nYear, nMonth, nDate) { 2728 | var diffDate, options, startLimit, today; 2729 | date = new Date(nYear, nMonth - 1, nDate); 2730 | if (isDisabled === 'disabled') { 2731 | return; 2732 | } 2733 | if (typeof scope.mgOptions.project !== 'undefined' && scope.mgOptions.project === 'flights') { 2734 | today = new Date(Calendar.getToday().getTime()).setHours(0, 0, 0, 0); 2735 | if (scope.mgOptions.isDomestic === 0 && today === date.getTime()) { 2736 | return; 2737 | } 2738 | options = scope.mgOptions; 2739 | if (options.trip === 'ow') { 2740 | scope.mgCallback({ 2741 | trip: 'ow', 2742 | where: 'sdate0' 2743 | }); 2744 | options.sdate0 = date; 2745 | drawSelectedFlight(); 2746 | $timeout((function() { 2747 | return scope.mgSelect(); 2748 | }), 300); 2749 | } else if (options.trip === 'rt') { 2750 | scope.mgCallback({ 2751 | trip: 'rt', 2752 | where: options.openButton 2753 | }); 2754 | if (options.openButton === 'sdate0') { 2755 | if (options.sdate1 !== null && options.sdate1.getTime() < date.getTime()) { 2756 | options.sdate1 = null; 2757 | options.sdate0 = date; 2758 | } else { 2759 | options.sdate0 = date; 2760 | } 2761 | } else if (scope.mgOptions.openButton === 'sdate1') { 2762 | if (options.sdate0 !== null && options.sdate0.getTime() > date.getTime()) { 2763 | options.sdate0 = date; 2764 | options.sdate1 = null; 2765 | } else { 2766 | options.sdate1 = date; 2767 | } 2768 | } 2769 | if (options.sdate1 === null) { 2770 | options.openButton = 'sdate1'; 2771 | } else { 2772 | options.openButton = 'sdate0'; 2773 | } 2774 | drawSelectedFlight(); 2775 | if (options.sdate0 !== null && options.sdate1 !== null) { 2776 | $timeout((function() { 2777 | return scope.mgSelect(); 2778 | }), 300); 2779 | } 2780 | } else if (options.trip === 'md') { 2781 | scope.mgCallback({ 2782 | trip: 'md', 2783 | where: options.openButton 2784 | }); 2785 | if (options.openButton === 'sdate0') { 2786 | options.sdate0 = new Date(date.getTime()); 2787 | if (options.sdate1 !== null && options.sdate1.getTime() < date.getTime()) { 2788 | options.sdate1 = null; 2789 | } 2790 | if (options.sdate2 !== null && options.sdate2.getTime() < date.getTime()) { 2791 | options.sdate1 = null; 2792 | options.sdate2 = null; 2793 | } 2794 | } else if (options.openButton === 'sdate1') { 2795 | options.sdate1 = new Date(date.getTime()); 2796 | if (options.sdate0 !== null && options.sdate0.getTime() > date.getTime()) { 2797 | options.sdate1 = null; 2798 | options.sdate0 = new Date(date.getTime()); 2799 | } 2800 | if (options.sdate2 !== null && options.sdate2.getTime() < date.getTime()) { 2801 | options.sdate2 = null; 2802 | } 2803 | } else if (options.openButton === 'sdate2') { 2804 | options.sdate2 = new Date(date.getTime()); 2805 | if (options.sdate1 !== null && options.sdate1.getTime() > date.getTime()) { 2806 | if (options.sdate0 !== null && options.sdate0.getTime() > date.getTime()) { 2807 | options.sdate2 = null; 2808 | options.sdate1 = null; 2809 | options.sdate0 = new Date(date.getTime()); 2810 | } else { 2811 | options.sdate2 = null; 2812 | options.sdate1 = new Date(date.getTime()); 2813 | } 2814 | } 2815 | } 2816 | if (options.sdate0 === null) { 2817 | options.openButton = 'sdate0'; 2818 | } else if (options.sdate1 === null) { 2819 | options.openButton = 'sdate1'; 2820 | } else if (options.sdate2 === null && options.isShowWay3 === true) { 2821 | options.openButton = 'sdate2'; 2822 | } 2823 | drawSelectedFlight(); 2824 | if (options.isShowWay3 === true && options.sdate0 !== null && options.sdate1 !== null && options.sdate2 !== null) { 2825 | $timeout((function() { 2826 | return scope.mgSelect(); 2827 | }), 300); 2828 | } else if (options.isShowWay3 === false && options.sdate0 !== null && options.sdate1 !== null) { 2829 | $timeout((function() { 2830 | return scope.mgSelect(); 2831 | }), 300); 2832 | } 2833 | } 2834 | return; 2835 | } 2836 | if (scope.mgButtonName === 'checkout' && scope.mgStart && scope.mgEnd) { 2837 | if (date <= scope.mgStart) { 2838 | scope.mgStart = date; 2839 | scope.mgEnd = null; 2840 | startSelected = true; 2841 | removeCheckInOut(); 2842 | drawCheckInCheckOut(); 2843 | if (scope.mgCallback) { 2844 | scope.mgCallback('start'); 2845 | } 2846 | return; 2847 | } 2848 | scope.mgEnd = date; 2849 | startSelected = false; 2850 | removeCheckInOut(); 2851 | drawCheckInCheckOut(); 2852 | if (scope.mgCallback) { 2853 | scope.mgCallback('end'); 2854 | } 2855 | return $timeout((function() { 2856 | return scope.mgSelect(); 2857 | }), 300); 2858 | } else { 2859 | if (scope.mgOptions.mgPenTodaysDeal) { 2860 | scope.mgEnd = date; 2861 | removeCheckOut(); 2862 | drawCheckInCheckOut(); 2863 | if (scope.mgCallback) { 2864 | scope.mgCallback('end'); 2865 | } 2866 | return $timeout((function() { 2867 | return scope.mgSelect(); 2868 | }), 300); 2869 | } else { 2870 | scope.mgEnd = null; 2871 | startLimit = new Date(scope.mgEnd); 2872 | startLimit.setDate(startLimit.getDate() - scope.mgOptions.limitNights); 2873 | if (!startSelected || (startSelected && date <= scope.mgStart)) { 2874 | if (!scope.mgButtonName || !scope.mgEnd || scope.mgEnd <= date || date < startLimit) { 2875 | if (scope.mgButtonName === 'checkin' && scope.mgStart !== null && scope.mgEnd !== null && date < scope.mgEnd) { 2876 | diffDate = (scope.mgEnd.getTime() - date.getTime()) / (1000 * 60 * 60 * 24); 2877 | if (scope.mgOptions.limitNights && diffDate > scope.mgOptions.limitNights) { 2878 | scope.mgStart = date; 2879 | scope.mgEnd = null; 2880 | startSelected = true; 2881 | removeCheckInOut(); 2882 | drawCheckInCheckOut(); 2883 | if (scope.mgCallback) { 2884 | return scope.mgCallback('start'); 2885 | } 2886 | } 2887 | scope.mgStart = date; 2888 | startSelected = true; 2889 | removeCheckInOut(); 2890 | drawCheckInCheckOut(); 2891 | if (scope.mgCallback) { 2892 | scope.mgCallback('start'); 2893 | } 2894 | return $timeout((function() { 2895 | return scope.mgSelect(); 2896 | }), 300); 2897 | } 2898 | scope.mgStart = date; 2899 | scope.mgEnd = null; 2900 | startSelected = true; 2901 | removeCheckInOut(); 2902 | drawCheckInCheckOut(); 2903 | if (scope.mgCallback) { 2904 | return scope.mgCallback('start'); 2905 | } 2906 | } else { 2907 | scope.mgStart = date; 2908 | removeCheckInOut(); 2909 | drawCheckInCheckOut(); 2910 | if (scope.mgCallback) { 2911 | scope.mgCallback('start'); 2912 | } 2913 | return $timeout((function() { 2914 | return scope.mgSelect(); 2915 | }), 300); 2916 | } 2917 | } else { 2918 | scope.mgEnd = date; 2919 | startSelected = false; 2920 | removeCheckInOut(); 2921 | drawCheckInCheckOut(); 2922 | if (scope.mgCallback) { 2923 | scope.mgCallback('end'); 2924 | } 2925 | return $timeout((function() { 2926 | return scope.mgSelect(); 2927 | }), 300); 2928 | } 2929 | } 2930 | } 2931 | } 2932 | }; 2933 | return activate(); 2934 | } 2935 | ] 2936 | }; 2937 | } 2938 | ]); 2939 | 2940 | }).call(this); 2941 | --------------------------------------------------------------------------------