├── .github └── FUNDING.yml ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── dist ├── css │ ├── bootstrap │ │ ├── icons.png │ │ ├── zebra_datepicker.css │ │ ├── zebra_datepicker.min.css │ │ └── zebra_datepicker.scss │ ├── default │ │ ├── icons.png │ │ ├── zebra_datepicker.css │ │ ├── zebra_datepicker.min.css │ │ └── zebra_datepicker.scss │ └── metallic │ │ ├── icons.png │ │ ├── zebra_datepicker.css │ │ ├── zebra_datepicker.min.css │ │ └── zebra_datepicker.scss ├── zebra_datepicker.min.js └── zebra_datepicker.src.js └── examples ├── bootstrap.html ├── close.png ├── examples.css ├── examples.js ├── favicon.ico ├── index.html └── metallic.html /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: stefangabos # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ### GNU LESSER GENERAL PUBLIC LICENSE 2 | 3 | Version 3, 29 June 2007 4 | 5 | Copyright (C) 2007 Free Software Foundation, Inc. 6 | 7 | 8 | Everyone is permitted to copy and distribute verbatim copies of this 9 | license document, but changing it is not allowed. 10 | 11 | This version of the GNU Lesser General Public License incorporates the 12 | terms and conditions of version 3 of the GNU General Public License, 13 | supplemented by the additional permissions listed below. 14 | 15 | #### 0. Additional Definitions. 16 | 17 | As used herein, "this License" refers to version 3 of the GNU Lesser 18 | General Public License, and the "GNU GPL" refers to version 3 of the 19 | GNU General Public License. 20 | 21 | "The Library" refers to a covered work governed by this License, other 22 | than an Application or a Combined Work as defined below. 23 | 24 | An "Application" is any work that makes use of an interface provided 25 | by the Library, but which is not otherwise based on the Library. 26 | Defining a subclass of a class defined by the Library is deemed a mode 27 | of using an interface provided by the Library. 28 | 29 | A "Combined Work" is a work produced by combining or linking an 30 | Application with the Library. The particular version of the Library 31 | with which the Combined Work was made is also called the "Linked 32 | Version". 33 | 34 | The "Minimal Corresponding Source" for a Combined Work means the 35 | Corresponding Source for the Combined Work, excluding any source code 36 | for portions of the Combined Work that, considered in isolation, are 37 | based on the Application, and not on the Linked Version. 38 | 39 | The "Corresponding Application Code" for a Combined Work means the 40 | object code and/or source code for the Application, including any data 41 | and utility programs needed for reproducing the Combined Work from the 42 | Application, but excluding the System Libraries of the Combined Work. 43 | 44 | #### 1. Exception to Section 3 of the GNU GPL. 45 | 46 | You may convey a covered work under sections 3 and 4 of this License 47 | without being bound by section 3 of the GNU GPL. 48 | 49 | #### 2. Conveying Modified Versions. 50 | 51 | If you modify a copy of the Library, and, in your modifications, a 52 | facility refers to a function or data to be supplied by an Application 53 | that uses the facility (other than as an argument passed when the 54 | facility is invoked), then you may convey a copy of the modified 55 | version: 56 | 57 | - a) under this License, provided that you make a good faith effort 58 | to ensure that, in the event an Application does not supply the 59 | function or data, the facility still operates, and performs 60 | whatever part of its purpose remains meaningful, or 61 | - b) under the GNU GPL, with none of the additional permissions of 62 | this License applicable to that copy. 63 | 64 | #### 3. Object Code Incorporating Material from Library Header Files. 65 | 66 | The object code form of an Application may incorporate material from a 67 | header file that is part of the Library. You may convey such object 68 | code under terms of your choice, provided that, if the incorporated 69 | material is not limited to numerical parameters, data structure 70 | layouts and accessors, or small macros, inline functions and templates 71 | (ten or fewer lines in length), you do both of the following: 72 | 73 | - a) Give prominent notice with each copy of the object code that 74 | the Library is used in it and that the Library and its use are 75 | covered by this License. 76 | - b) Accompany the object code with a copy of the GNU GPL and this 77 | license document. 78 | 79 | #### 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, taken 82 | together, effectively do not restrict modification of the portions of 83 | the Library contained in the Combined Work and reverse engineering for 84 | debugging such modifications, if you also do each of the following: 85 | 86 | - a) Give prominent notice with each copy of the Combined Work that 87 | the Library is used in it and that the Library and its use are 88 | covered by this License. 89 | - b) Accompany the Combined Work with a copy of the GNU GPL and this 90 | license document. 91 | - c) For a Combined Work that displays copyright notices during 92 | execution, include the copyright notice for the Library among 93 | these notices, as well as a reference directing the user to the 94 | copies of the GNU GPL and this license document. 95 | - d) Do one of the following: 96 | - 0) Convey the Minimal Corresponding Source under the terms of 97 | this License, and the Corresponding Application Code in a form 98 | suitable for, and under terms that permit, the user to 99 | recombine or relink the Application with a modified version of 100 | the Linked Version to produce a modified Combined Work, in the 101 | manner specified by section 6 of the GNU GPL for conveying 102 | Corresponding Source. 103 | - 1) Use a suitable shared library mechanism for linking with 104 | the Library. A suitable mechanism is one that (a) uses at run 105 | time a copy of the Library already present on the user's 106 | computer system, and (b) will operate properly with a modified 107 | version of the Library that is interface-compatible with the 108 | Linked Version. 109 | - e) Provide Installation Information, but only if you would 110 | otherwise be required to provide such information under section 6 111 | of the GNU GPL, and only to the extent that such information is 112 | necessary to install and execute a modified version of the 113 | Combined Work produced by recombining or relinking the Application 114 | with a modified version of the Linked Version. (If you use option 115 | 4d0, the Installation Information must accompany the Minimal 116 | Corresponding Source and Corresponding Application Code. If you 117 | use option 4d1, you must provide the Installation Information in 118 | the manner specified by section 6 of the GNU GPL for conveying 119 | Corresponding Source.) 120 | 121 | #### 5. Combined Libraries. 122 | 123 | You may place library facilities that are a work based on the Library 124 | side by side in a single library together with other library 125 | facilities that are not Applications and are not covered by this 126 | License, and convey such a combined library under terms of your 127 | choice, if you do both of the following: 128 | 129 | - a) Accompany the combined library with a copy of the same work 130 | based on the Library, uncombined with any other library 131 | facilities, conveyed under the terms of this License. 132 | - b) Give prominent notice with the combined library that part of it 133 | is a work based on the Library, and explaining where to find the 134 | accompanying uncombined form of the same work. 135 | 136 | #### 6. Revised Versions of the GNU Lesser General Public License. 137 | 138 | The Free Software Foundation may publish revised and/or new versions 139 | of the GNU Lesser General Public License from time to time. Such new 140 | versions will be similar in spirit to the present version, but may 141 | differ in detail to address new problems or concerns. 142 | 143 | Each version is given a distinguishing version number. If the Library 144 | as you received it specifies that a certain numbered version of the 145 | GNU Lesser General Public License "or any later version" applies to 146 | it, you have the option of following the terms and conditions either 147 | of that published version or of any later version published by the 148 | Free Software Foundation. If the Library as you received it does not 149 | specify a version number of the GNU Lesser General Public License, you 150 | may choose any version of the GNU Lesser General Public License ever 151 | published by the Free Software Foundation. 152 | 153 | If the Library as you received it specifies that a proxy can decide 154 | whether future versions of the GNU Lesser General Public License shall 155 | apply, that proxy's public statement of acceptance of any version is 156 | permanent authorization for you to choose that version for the 157 | Library. -------------------------------------------------------------------------------- /dist/css/bootstrap/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefangabos/Zebra_Datepicker/881d1a6023d4d7cd265d9baa5e6420934c721863/dist/css/bootstrap/icons.png -------------------------------------------------------------------------------- /dist/css/bootstrap/zebra_datepicker.css: -------------------------------------------------------------------------------- 1 | .Zebra_DatePicker { 2 | background: #fff; 3 | border: 1px solid #aaa; 4 | border-radius: 4px; 5 | box-shadow: 0 0 10px #ccc; 6 | color: #222; 7 | font: 13px Tahoma,Arial,Helvetica,sans-serif; 8 | padding: 5px; 9 | position: absolute; 10 | display: table; 11 | z-index: 1200 12 | } 13 | .Zebra_DatePicker *, 14 | .Zebra_DatePicker :after, 15 | .Zebra_DatePicker :before { 16 | box-sizing: content-box!important 17 | } 18 | .Zebra_DatePicker * { 19 | padding: 0 20 | } 21 | .Zebra_DatePicker table { 22 | border-collapse: collapse; 23 | border-radius: 4px; 24 | border-spacing: 0; 25 | width: 100% 26 | } 27 | .Zebra_DatePicker td, 28 | .Zebra_DatePicker th { 29 | border-radius: 4px; 30 | padding: 5px; 31 | cursor: pointer; 32 | text-align: center; 33 | min-width: 25px; 34 | width: 25px 35 | } 36 | .Zebra_DatePicker .dp_body .dp_not_in_month { 37 | color: #666 38 | } 39 | .Zebra_DatePicker .dp_body .dp_time_controls_condensed td { 40 | width: 25% 41 | } 42 | .Zebra_DatePicker .dp_body .dp_current { 43 | color: #3a87ad 44 | } 45 | .Zebra_DatePicker .dp_body .dp_selected { 46 | background: #337ab7; 47 | color: #fff 48 | } 49 | .Zebra_DatePicker .dp_body .dp_disabled { 50 | color: #bbb; 51 | cursor: text 52 | } 53 | .Zebra_DatePicker .dp_body .dp_disabled.dp_current { 54 | color: #b3d5e5 55 | } 56 | .Zebra_DatePicker .dp_monthpicker td, 57 | .Zebra_DatePicker .dp_timepicker td, 58 | .Zebra_DatePicker .dp_yearpicker td { 59 | width: 33.3333% 60 | } 61 | .Zebra_DatePicker .dp_timepicker .dp_disabled { 62 | border: none; 63 | color: #222; 64 | font-size: 26px; 65 | font-weight: 700 66 | } 67 | .Zebra_DatePicker .dp_time_separator div { 68 | position: relative 69 | } 70 | .Zebra_DatePicker .dp_time_separator div:after { 71 | content: ":"; 72 | color: #222; 73 | font-size: 20px; 74 | left: 100%; 75 | margin-left: 2px; 76 | margin-top: -13px; 77 | position: absolute; 78 | top: 50%; 79 | z-index: 1 80 | } 81 | .Zebra_DatePicker .dp_header { 82 | margin-bottom: 5px 83 | } 84 | @supports (-ms-ime-align:auto) { 85 | .Zebra_DatePicker .dp_header { 86 | font-family: "Segoe UI Symbol",Tahoma,Arial,Helvetica,sans-serif 87 | } 88 | } 89 | .Zebra_DatePicker .dp_footer { 90 | margin-top: 5px 91 | } 92 | .Zebra_DatePicker .dp_footer .dp_icon { 93 | width: 50% 94 | } 95 | .Zebra_DatePicker .dp_actions td { 96 | border-radius: 4px 97 | } 98 | .Zebra_DatePicker .dp_actions .dp_caption { 99 | font-weight: 700; 100 | width: 100% 101 | } 102 | @media (hover:hover) { 103 | .Zebra_DatePicker .dp_body .dp_hover { 104 | background: #dedede 105 | } 106 | .Zebra_DatePicker .dp_actions .dp_hover, 107 | .Zebra_DatePicker .dp_body .dp_hover.dp_time_control { 108 | background-color: #dedede 109 | } 110 | } 111 | .Zebra_DatePicker .dp_daypicker th { 112 | cursor: text; 113 | font-weight: 700 114 | } 115 | .Zebra_DatePicker.dp_hidden { 116 | display: none 117 | } 118 | .Zebra_DatePicker .dp_icon { 119 | height: 16px; 120 | background-image: url("icons.png"); 121 | background-repeat: no-repeat; 122 | text-indent: -9999px 123 | } 124 | .Zebra_DatePicker .dp_icon.dp_confirm { 125 | background-position: center -123px 126 | } 127 | .Zebra_DatePicker .dp_icon.dp_view_toggler { 128 | background-position: center -91px 129 | } 130 | .Zebra_DatePicker .dp_icon.dp_view_toggler.dp_calendar { 131 | background-position: center -59px 132 | } 133 | button.Zebra_DatePicker_Icon { 134 | background: url("icons.png") center top no-repeat; 135 | border: none; 136 | cursor: pointer; 137 | display: block; 138 | height: 16px; 139 | line-height: 0; 140 | padding: 0; 141 | position: absolute; 142 | text-indent: -9000px; 143 | width: 16px 144 | } 145 | button.Zebra_DatePicker_Icon.Zebra_DatePicker_Icon_Disabled { 146 | background-position: center -32px; 147 | cursor: default 148 | } -------------------------------------------------------------------------------- /dist/css/bootstrap/zebra_datepicker.min.css: -------------------------------------------------------------------------------- 1 | .Zebra_DatePicker{background:#fff;border:1px solid #aaa;border-radius:4px;box-shadow:0 0 10px #ccc;color:#222;font:13px Tahoma,Arial,Helvetica,sans-serif;padding:5px;position:absolute;display:table;z-index:1200}.Zebra_DatePicker *,.Zebra_DatePicker :after,.Zebra_DatePicker :before{box-sizing:content-box!important}.Zebra_DatePicker *{padding:0}.Zebra_DatePicker table{border-collapse:collapse;border-radius:4px;border-spacing:0;width:100%}.Zebra_DatePicker td,.Zebra_DatePicker th{border-radius:4px;padding:5px;cursor:pointer;text-align:center;min-width:25px;width:25px}.Zebra_DatePicker .dp_body .dp_not_in_month{color:#666}.Zebra_DatePicker .dp_body .dp_time_controls_condensed td{width:25%}.Zebra_DatePicker .dp_body .dp_current{color:#3a87ad}.Zebra_DatePicker .dp_body .dp_selected{background:#337ab7;color:#fff}.Zebra_DatePicker .dp_body .dp_disabled{color:#bbb;cursor:text}.Zebra_DatePicker .dp_body .dp_disabled.dp_current{color:#b3d5e5}.Zebra_DatePicker .dp_monthpicker td,.Zebra_DatePicker .dp_timepicker td,.Zebra_DatePicker .dp_yearpicker td{width:33.3333%}.Zebra_DatePicker .dp_timepicker .dp_disabled{border:none;color:#222;font-size:26px;font-weight:700}.Zebra_DatePicker .dp_time_separator div{position:relative}.Zebra_DatePicker .dp_time_separator div:after{content:":";color:#222;font-size:20px;left:100%;margin-left:2px;margin-top:-13px;position:absolute;top:50%;z-index:1}.Zebra_DatePicker .dp_header{margin-bottom:5px}@supports(-ms-ime-align:auto){.Zebra_DatePicker .dp_header{font-family:"Segoe UI Symbol",Tahoma,Arial,Helvetica,sans-serif}}.Zebra_DatePicker .dp_footer{margin-top:5px}.Zebra_DatePicker .dp_footer .dp_icon{width:50%}.Zebra_DatePicker .dp_actions td{border-radius:4px}.Zebra_DatePicker .dp_actions .dp_caption{font-weight:700;width:100%}@media(hover:hover){.Zebra_DatePicker .dp_body .dp_hover{background:#dedede}.Zebra_DatePicker .dp_actions .dp_hover,.Zebra_DatePicker .dp_body .dp_hover.dp_time_control{background-color:#dedede}}.Zebra_DatePicker .dp_daypicker th{cursor:text;font-weight:700}.Zebra_DatePicker.dp_hidden{display:none}.Zebra_DatePicker .dp_icon{height:16px;background-image:url("icons.png");background-repeat:no-repeat;text-indent:-9999px}.Zebra_DatePicker .dp_icon.dp_confirm{background-position:center -123px}.Zebra_DatePicker .dp_icon.dp_view_toggler{background-position:center -91px}.Zebra_DatePicker .dp_icon.dp_view_toggler.dp_calendar{background-position:center -59px}button.Zebra_DatePicker_Icon{background:url("icons.png") center top no-repeat;border:none;cursor:pointer;display:block;height:16px;line-height:0;padding:0;position:absolute;text-indent:-9000px;width:16px}button.Zebra_DatePicker_Icon.Zebra_DatePicker_Icon_Disabled{background-position:center -32px;cursor:default} -------------------------------------------------------------------------------- /dist/css/bootstrap/zebra_datepicker.scss: -------------------------------------------------------------------------------- 1 | @use 'sass:color'; 2 | 3 | $dp_background: #fff; 4 | $dp_border: 1px solid #aaa; 5 | $dp_border_radius: 4px; 6 | $dp_box_shadow: 0px 0px 10px #ccc; 7 | $dp_color: #222; 8 | $dp_font_size: 13px; 9 | $dp_font_family: Tahoma, Arial, Helvetica, sans-serif; 10 | $dp_padding_width_horizontal: 5px; 11 | $dp_padding_width_vertical: 5px; 12 | 13 | $dp_cell_border_radius: 4px; 14 | $dp_cell_hover_background: #dedede; 15 | $dp_cell_min_width: 25px; 16 | $dp_cell_padding: 5px; 17 | 18 | $dp_header_hover_background: $dp_cell_hover_background; 19 | $dp_header_padding: 5px; 20 | 21 | $dp_weekday_color: $dp_color; 22 | $dp_weekday_disabled_color: color.adjust($dp_weekday_color, $lightness: 60%); 23 | 24 | $dp_weekend_color: $dp_color; 25 | $dp_weekend_disabled_color: $dp_weekday_disabled_color; 26 | 27 | $dp_not_in_month_color: #666; 28 | $dp_not_in_month_disabled_color: $dp_weekday_disabled_color; 29 | 30 | $dp_current_date_color: #3a87ad; 31 | $dp_current_date_disabled_color: color.adjust($dp_current_date_color, $lightness: 35%); 32 | 33 | $dp_selected_date_background: #337ab7; 34 | $dp_selected_date_color: #fff; 35 | 36 | $dp_heading_color: $dp_color; 37 | 38 | $dp_time_control_color: $dp_weekday_color; 39 | 40 | $dp_time_color: $dp_weekday_color; 41 | //$dp_time_separator_color: $dp_cell_border; 42 | 43 | @use "sass:meta"; 44 | @use "sass:math"; 45 | 46 | .Zebra_DatePicker { 47 | background: $dp_background; 48 | @if meta.variable-exists(dp_border) { border: $dp_border; } 49 | @if meta.variable-exists(dp_border_radius) { border-radius: $dp_border_radius; } 50 | @if meta.variable-exists(dp_box_shadow) { box-shadow: $dp_box_shadow; } 51 | color: $dp_color; 52 | font: $dp_font_size $dp_font_family; 53 | padding: $dp_padding_width_vertical $dp_padding_width_horizontal; 54 | position: absolute; 55 | display: table; 56 | z-index: 1200; 57 | 58 | & *, 59 | & *:after, 60 | & *:before { 61 | box-sizing: content-box !important; 62 | } 63 | 64 | & * { 65 | padding: 0; 66 | } 67 | 68 | table { 69 | border-collapse: collapse; 70 | @if meta.variable-exists(dp_border_radius) { border-radius: $dp_border_radius; } 71 | border-spacing: 0; 72 | width: 100%; 73 | } 74 | 75 | th, td { 76 | @if meta.variable-exists(dp_cell_border_radius) { border-radius: $dp_cell_border_radius; } 77 | @if meta.variable-exists(dp_cell_padding) { padding: $dp_cell_padding; } 78 | cursor: pointer; 79 | text-align: center; 80 | min-width: $dp_cell_min_width; 81 | width: $dp_cell_min_width; 82 | } 83 | 84 | .dp_body { 85 | @if meta.variable-exists(dp_cell_border) { 86 | th, td { 87 | border: $dp_cell_border; 88 | &:first-child { 89 | border-left: none; 90 | } 91 | &:last-child { 92 | border-right: none; 93 | } 94 | } 95 | 96 | tr:first-child th, 97 | tr:first-child td { 98 | border-top: none; 99 | } 100 | 101 | tr:last-child th, 102 | tr:last-child td { 103 | border-bottom: none; 104 | } 105 | } 106 | 107 | td { 108 | @if meta.variable-exists(dp_weekday_background) and $dp_weekday_background != $dp_background { background: $dp_weekday_background; } 109 | @if meta.variable-exists(dp_weekday_color) and $dp_weekday_color != $dp_color { color: $dp_weekday_color; } 110 | } 111 | 112 | .dp_weekend { 113 | @if meta.variable-exists(dp_weekend_background) and $dp_weekend_background != (if(meta.variable_exists(dp_weekday_background), $dp_weekday_background, $dp_background)) { background: $dp_weekend_background; } 114 | @if meta.variable-exists(dp_weekend_color) and $dp_weekend_color != (if(meta.variable_exists(dp_weekday_color), $dp_weekday_color, $dp_color)) { color: $dp_weekend_color; } 115 | } 116 | 117 | .dp_not_in_month { 118 | @if meta.variable-exists(dp_not_in_month_background) and $dp_not_in_month_background != (if(meta.variable_exists(dp_weekday_background), $dp_weekday_background, $dp_background)) { background: $dp_not_in_month_background; } 119 | @if meta.variable-exists(dp_not_in_month_color) and $dp_not_in_month_color != (if(meta.variable_exists(dp_weekday_color), $dp_weekday_color, $dp_color)) { color: $dp_not_in_month_color; } 120 | } 121 | .dp_time_control { 122 | @if meta.variable-exists(dp_time_control_background) and $dp_time_control_background != $dp_weekday_background { background: $dp_time_control_background; } 123 | @if meta.variable-exists(dp_time_control_color) and $dp_time_control_color != $dp_weekday_color { background: $dp_time_control_color; } 124 | } 125 | 126 | .dp_time_controls_condensed { 127 | td { 128 | width: 25%; 129 | } 130 | } 131 | 132 | .dp_current { 133 | @if meta.variable-exists(dp_current_date_background) and $dp_current_date_background != $dp_background { background: $dp_current_date_background; } 134 | @if meta.variable-exists(dp_current_date_color) and $dp_current_date_color != $dp_color { color: $dp_current_date_color; } 135 | } 136 | 137 | .dp_selected { 138 | @if meta.variable-exists(dp_selected_date_background) and $dp_selected_date_background != $dp_background { background: $dp_selected_date_background; } 139 | @if meta.variable-exists(dp_selected_date_color) { color: $dp_selected_date_color; } 140 | } 141 | 142 | .dp_disabled { 143 | @if meta.variable-exists(dp_weekday_disabled_background) and $dp_weekday_disabled_background != $dp_background { background: $dp_weekday_disabled_background; } 144 | @if meta.variable-exists(dp_weekday_disabled_color) and $dp_weekday_disabled_color != $dp_color { color: $dp_weekday_disabled_color; } 145 | cursor: text; 146 | 147 | &.dp_not_in_month { 148 | @if meta.variable-exists(dp_not_in_month_disabled_background) and $dp_not_in_month_disabled_background != (if(meta.variable_exists(dp_weekday_disabled_background), $dp_weekday_disabled_background, $dp_background)) { background: $dp_not_in_month_disabled_background; } 149 | @if meta.variable-exists(dp_not_in_month_disabled_color) and $dp_not_in_month_disabled_color != (if(meta.variable_exists(dp_weekday_disabled_color), $dp_weekday_disabled_color, $dp_color)) { color: $dp_not_in_month_disabled_color; } 150 | } 151 | 152 | &.dp_weekend { 153 | @if meta.variable-exists(dp_weekend_disabled_background) and $dp_weekend_disabled_background != (if(meta.variable_exists(dp_weekday_disabled_background), $dp_weekday_disabled_background, $dp_background)) { background: $dp_weekend_disabled_background; } 154 | @if meta.variable-exists(dp_weekend_disabled_color) and $dp_weekend_disabled_color != (if(meta.variable_exists(dp_weekday_disabled_color), $dp_weekday_disabled_color, $dp_color)) { color: $dp_weekend_disabled_color; } 155 | } 156 | 157 | &.dp_current { 158 | @if meta.variable-exists(dp_current_date_disabled_background) and $dp_current_date_disabled_background != (if(meta.variable_exists(dp_weekday_disabled_background), $dp_weekday_disabled_background, $dp_background)) { background: $dp_current_date_disabled_background; } 159 | @if meta.variable-exists(dp_current_date_disabled_color) and $dp_current_date_disabled_color != (if(meta.variable_exists(dp_weekday_disabled_color), $dp_weekday_disabled_color, $dp_color)) { color: $dp_current_date_disabled_color; } 160 | } 161 | } 162 | 163 | @media (hover: hover) { 164 | .dp_hover { 165 | @if meta.variable-exists(dp_cell_hover_color) { color: $dp_cell_hover_color; } 166 | @if meta.variable-exists(dp_cell_hover_background) { background: $dp_cell_hover_background; } 167 | &.dp_time_control { 168 | @if meta.variable-exists(dp_header_hover_background) and $dp_header_hover_background != $dp_background { background-color: $dp_header_hover_background; } 169 | @if meta.variable-exists(dp_header_hover_color) and $dp_header_hover_color != $dp_color { color: $dp_header_hover_color; } 170 | } 171 | } 172 | } 173 | 174 | } 175 | 176 | .dp_monthpicker, 177 | .dp_yearpicker, 178 | .dp_timepicker { 179 | td { 180 | width: 33.3333%; 181 | } 182 | } 183 | 184 | .dp_timepicker .dp_disabled { 185 | @if meta.variable-exists(dp_time_background) and $dp_time_background != $dp_weekday_disabled_background { background: $dp_time_background; } 186 | border: none; 187 | color: if(meta.variable-exists(dp_time_color), $dp_time_color, if(meta.variable-exists(dp_weekday_color), $dp_weekday_color, $dp_color)); 188 | font-size: math.ceil($dp_font_size * 2); 189 | font-weight: bold; 190 | } 191 | 192 | .dp_time_separator { 193 | div { 194 | position: relative; 195 | &:after { 196 | content: ":"; 197 | color: if(meta.variable-exists(dp_time_separator_color), $dp_time_separator_color, if(meta.variable-exists(dp_weekday_color), $dp_weekday_color, $dp_color)); 198 | font-size: math.ceil($dp_font_size * 1.5); 199 | left: 100%; 200 | margin-left: 2px; 201 | margin-top: -$dp_font_size; 202 | position: absolute; 203 | top: 50%; 204 | z-index: 1; 205 | } 206 | } 207 | } 208 | 209 | .dp_header { 210 | @if meta.variable-exists(dp_padding_width_vertical) { margin-bottom: $dp_padding_width_vertical; } 211 | 212 | // fix for Edge replacing ◀ and ▶ Unicode symbols with emojis 213 | // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11844964/ 214 | @supports (-ms-ime-align:auto) { 215 | font-family: 'Segoe UI Symbol', Tahoma, Arial, Helvetica, sans-serif; 216 | } 217 | } 218 | 219 | .dp_footer { 220 | @if meta.variable-exists(dp_padding_width_vertical) { margin-top: $dp_padding_width_vertical; } 221 | .dp_icon { 222 | width: 50%; 223 | } 224 | } 225 | 226 | .dp_actions { 227 | td { 228 | @if meta.variable-exists(dp_header_background) and $dp_header_background != $dp_background { background: $dp_header_background; } 229 | @if meta.variable-exists(dp_border_radius) { border-radius: $dp_border_radius; } 230 | @if meta.variable-exists(dp_header_color) and $dp_header_color != $dp_color { color: $dp_header_color; } 231 | @if meta.variable-exists(dp_header_padding) and $dp_header_padding != $dp_cell_padding { padding: $dp_header_padding; } 232 | } 233 | 234 | .dp_caption { 235 | font-weight: bold; 236 | width: 100%; 237 | } 238 | 239 | @media (hover: hover) { 240 | .dp_hover { 241 | @if meta.variable-exists(dp_header_hover_background) and $dp_header_hover_background != $dp_background { background-color: $dp_header_hover_background; } 242 | @if meta.variable-exists(dp_header_hover_color) and $dp_header_hover_color != $dp_color { color: $dp_header_hover_color; } 243 | } 244 | } 245 | } 246 | 247 | .dp_daypicker th { 248 | @if meta.variable-exists(dp_heading_background) and $dp_heading_background != $dp_background { background: $dp_heading_background; } 249 | @if meta.variable-exists(dp_heading_color) and $dp_heading_color != $dp_color { color: $dp_heading_color; } 250 | cursor: text; 251 | font-weight: bold; 252 | } 253 | 254 | &.dp_hidden { 255 | display: none; 256 | } 257 | 258 | .dp_icon { 259 | height: 16px; 260 | background-image: url('icons.png'); 261 | background-repeat: no-repeat; 262 | text-indent: -9999px; 263 | 264 | &.dp_confirm { 265 | background-position: center -#{128 - $dp_header_padding}; 266 | } 267 | 268 | &.dp_view_toggler { 269 | background-position: center -#{96 - $dp_header_padding}; 270 | 271 | &.dp_calendar { 272 | background-position: center -#{64 - $dp_header_padding}; 273 | } 274 | } 275 | } 276 | } 277 | 278 | button.Zebra_DatePicker_Icon { 279 | background: url('icons.png') no-repeat center top; 280 | border: none; 281 | cursor: pointer; 282 | display: block; 283 | height: 16px; 284 | line-height: 0; 285 | padding: 0; 286 | position: absolute; 287 | text-indent: -9000px; 288 | width: 16px; 289 | 290 | &.Zebra_DatePicker_Icon_Disabled { 291 | background-position: center -32px; 292 | cursor: default; 293 | } 294 | } 295 | 296 | -------------------------------------------------------------------------------- /dist/css/default/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefangabos/Zebra_Datepicker/881d1a6023d4d7cd265d9baa5e6420934c721863/dist/css/default/icons.png -------------------------------------------------------------------------------- /dist/css/default/zebra_datepicker.css: -------------------------------------------------------------------------------- 1 | .Zebra_DatePicker { 2 | background: #666; 3 | border-radius: 4px; 4 | box-shadow: 0 0 10px #888; 5 | color: #222; 6 | font: 13px Tahoma,Arial,Helvetica,sans-serif; 7 | padding: 3px; 8 | position: absolute; 9 | display: table; 10 | z-index: 1200 11 | } 12 | .Zebra_DatePicker *, 13 | .Zebra_DatePicker :after, 14 | .Zebra_DatePicker :before { 15 | box-sizing: content-box!important 16 | } 17 | .Zebra_DatePicker * { 18 | padding: 0 19 | } 20 | .Zebra_DatePicker table { 21 | border-collapse: collapse; 22 | border-radius: 4px; 23 | border-spacing: 0; 24 | width: 100% 25 | } 26 | .Zebra_DatePicker td, 27 | .Zebra_DatePicker th { 28 | padding: 5px; 29 | cursor: pointer; 30 | text-align: center; 31 | min-width: 25px; 32 | width: 25px 33 | } 34 | .Zebra_DatePicker .dp_body td, 35 | .Zebra_DatePicker .dp_body th { 36 | border: 1px solid #bfbfbf 37 | } 38 | .Zebra_DatePicker .dp_body td:first-child, 39 | .Zebra_DatePicker .dp_body th:first-child { 40 | border-left: none 41 | } 42 | .Zebra_DatePicker .dp_body td:last-child, 43 | .Zebra_DatePicker .dp_body th:last-child { 44 | border-right: none 45 | } 46 | .Zebra_DatePicker .dp_body tr:first-child td, 47 | .Zebra_DatePicker .dp_body tr:first-child th { 48 | border-top: none 49 | } 50 | .Zebra_DatePicker .dp_body tr:last-child td, 51 | .Zebra_DatePicker .dp_body tr:last-child th { 52 | border-bottom: none 53 | } 54 | .Zebra_DatePicker .dp_body td { 55 | background: #e5e5e5 56 | } 57 | .Zebra_DatePicker .dp_body .dp_weekend { 58 | background: #d6d6d6 59 | } 60 | .Zebra_DatePicker .dp_body .dp_not_in_month { 61 | background: #e0e6f2; 62 | color: #98acd3 63 | } 64 | .Zebra_DatePicker .dp_body .dp_time_controls_condensed td { 65 | width: 25% 66 | } 67 | .Zebra_DatePicker .dp_body .dp_current { 68 | color: #cc236b 69 | } 70 | .Zebra_DatePicker .dp_body .dp_selected { 71 | background: #b56a6a; 72 | color: #fff 73 | } 74 | .Zebra_DatePicker .dp_body .dp_disabled { 75 | background: #f2f2f2; 76 | color: #ccc; 77 | cursor: text 78 | } 79 | .Zebra_DatePicker .dp_body .dp_disabled.dp_current { 80 | color: #b56a6a 81 | } 82 | @media (hover:hover) { 83 | .Zebra_DatePicker .dp_body .dp_hover { 84 | color: #fff; 85 | background: #88a09e 86 | } 87 | .Zebra_DatePicker .dp_body .dp_hover.dp_time_control { 88 | background-color: #8c8c8c; 89 | color: #fff 90 | } 91 | } 92 | .Zebra_DatePicker .dp_monthpicker td, 93 | .Zebra_DatePicker .dp_timepicker td, 94 | .Zebra_DatePicker .dp_yearpicker td { 95 | width: 33.3333% 96 | } 97 | .Zebra_DatePicker .dp_timepicker .dp_disabled { 98 | border: none; 99 | color: #222; 100 | font-size: 26px; 101 | font-weight: 700 102 | } 103 | .Zebra_DatePicker .dp_time_separator div { 104 | position: relative 105 | } 106 | .Zebra_DatePicker .dp_time_separator div:after { 107 | content: ":"; 108 | color: 1px solid #bfbfbf; 109 | font-size: 20px; 110 | left: 100%; 111 | margin-left: 2px; 112 | margin-top: -13px; 113 | position: absolute; 114 | top: 50%; 115 | z-index: 1 116 | } 117 | .Zebra_DatePicker .dp_header { 118 | margin-bottom: 3px 119 | } 120 | @supports (-ms-ime-align:auto) { 121 | .Zebra_DatePicker .dp_header { 122 | font-family: "Segoe UI Symbol",Tahoma,Arial,Helvetica,sans-serif 123 | } 124 | } 125 | .Zebra_DatePicker .dp_footer { 126 | margin-top: 3px 127 | } 128 | .Zebra_DatePicker .dp_footer .dp_icon { 129 | width: 50% 130 | } 131 | .Zebra_DatePicker .dp_actions td { 132 | border-radius: 4px; 133 | color: #fff 134 | } 135 | .Zebra_DatePicker .dp_actions .dp_caption { 136 | font-weight: 700; 137 | width: 100% 138 | } 139 | @media (hover:hover) { 140 | .Zebra_DatePicker .dp_actions .dp_hover { 141 | background-color: #8c8c8c; 142 | color: #fff 143 | } 144 | } 145 | .Zebra_DatePicker .dp_daypicker th { 146 | background: #fc3; 147 | cursor: text; 148 | font-weight: 700 149 | } 150 | .Zebra_DatePicker.dp_hidden { 151 | display: none 152 | } 153 | .Zebra_DatePicker .dp_icon { 154 | height: 16px; 155 | background-image: url("icons.png"); 156 | background-repeat: no-repeat; 157 | text-indent: -9999px 158 | } 159 | .Zebra_DatePicker .dp_icon.dp_confirm { 160 | background-position: center -123px 161 | } 162 | .Zebra_DatePicker .dp_icon.dp_view_toggler { 163 | background-position: center -91px 164 | } 165 | .Zebra_DatePicker .dp_icon.dp_view_toggler.dp_calendar { 166 | background-position: center -59px 167 | } 168 | button.Zebra_DatePicker_Icon { 169 | background: url("icons.png") center top no-repeat; 170 | border: none; 171 | cursor: pointer; 172 | display: block; 173 | height: 16px; 174 | line-height: 0; 175 | padding: 0; 176 | position: absolute; 177 | text-indent: -9000px; 178 | width: 16px 179 | } 180 | button.Zebra_DatePicker_Icon.Zebra_DatePicker_Icon_Disabled { 181 | background-position: center -32px; 182 | cursor: default 183 | } -------------------------------------------------------------------------------- /dist/css/default/zebra_datepicker.min.css: -------------------------------------------------------------------------------- 1 | .Zebra_DatePicker{background:#666;border-radius:4px;box-shadow:0 0 10px #888;color:#222;font:13px Tahoma,Arial,Helvetica,sans-serif;padding:3px;position:absolute;display:table;z-index:1200}.Zebra_DatePicker *,.Zebra_DatePicker :after,.Zebra_DatePicker :before{box-sizing:content-box!important}.Zebra_DatePicker *{padding:0}.Zebra_DatePicker table{border-collapse:collapse;border-radius:4px;border-spacing:0;width:100%}.Zebra_DatePicker td,.Zebra_DatePicker th{padding:5px;cursor:pointer;text-align:center;min-width:25px;width:25px}.Zebra_DatePicker .dp_body td,.Zebra_DatePicker .dp_body th{border:1px solid #bfbfbf}.Zebra_DatePicker .dp_body td:first-child,.Zebra_DatePicker .dp_body th:first-child{border-left:none}.Zebra_DatePicker .dp_body td:last-child,.Zebra_DatePicker .dp_body th:last-child{border-right:none}.Zebra_DatePicker .dp_body tr:first-child td,.Zebra_DatePicker .dp_body tr:first-child th{border-top:none}.Zebra_DatePicker .dp_body tr:last-child td,.Zebra_DatePicker .dp_body tr:last-child th{border-bottom:none}.Zebra_DatePicker .dp_body td{background:#e5e5e5}.Zebra_DatePicker .dp_body .dp_weekend{background:#d6d6d6}.Zebra_DatePicker .dp_body .dp_not_in_month{background:#e0e6f2;color:#97abd2}.Zebra_DatePicker .dp_body .dp_time_controls_condensed td{width:25%}.Zebra_DatePicker .dp_body .dp_current{color:#cc236b}.Zebra_DatePicker .dp_body .dp_selected{background:#b56a6a;color:#fff}.Zebra_DatePicker .dp_body .dp_disabled{background:#f2f2f2;color:#ccc;cursor:text}.Zebra_DatePicker .dp_body .dp_disabled.dp_current{color:#b56a6a}@media(hover:hover){.Zebra_DatePicker .dp_body .dp_hover{color:#fff;background:#88a09e}.Zebra_DatePicker .dp_body .dp_hover.dp_time_control{background-color:#8c8c8c;color:#fff}}.Zebra_DatePicker .dp_monthpicker td,.Zebra_DatePicker .dp_timepicker td,.Zebra_DatePicker .dp_yearpicker td{width:33.3333%}.Zebra_DatePicker .dp_timepicker .dp_disabled{border:none;color:#222;font-size:26px;font-weight:700}.Zebra_DatePicker .dp_time_separator div{position:relative}.Zebra_DatePicker .dp_time_separator div:after{content:":";color:1px solid #bfbfbf;font-size:20px;left:100%;margin-left:2px;margin-top:-13px;position:absolute;top:50%;z-index:1}.Zebra_DatePicker .dp_header{margin-bottom:3px}@supports(-ms-ime-align:auto){.Zebra_DatePicker .dp_header{font-family:"Segoe UI Symbol",Tahoma,Arial,Helvetica,sans-serif}}.Zebra_DatePicker .dp_footer{margin-top:3px}.Zebra_DatePicker .dp_footer .dp_icon{width:50%}.Zebra_DatePicker .dp_actions td{border-radius:4px;color:#fff}.Zebra_DatePicker .dp_actions .dp_caption{font-weight:700;width:100%}@media(hover:hover){.Zebra_DatePicker .dp_actions .dp_hover{background-color:#8c8c8c;color:#fff}}.Zebra_DatePicker .dp_daypicker th{background:#fc3;cursor:text;font-weight:700}.Zebra_DatePicker.dp_hidden{display:none}.Zebra_DatePicker .dp_icon{height:16px;background-image:url("icons.png");background-repeat:no-repeat;text-indent:-9999px}.Zebra_DatePicker .dp_icon.dp_confirm{background-position:center -123px}.Zebra_DatePicker .dp_icon.dp_view_toggler{background-position:center -91px}.Zebra_DatePicker .dp_icon.dp_view_toggler.dp_calendar{background-position:center -59px}button.Zebra_DatePicker_Icon{background:url("icons.png") center top no-repeat;border:none;cursor:pointer;display:block;height:16px;line-height:0;padding:0;position:absolute;text-indent:-9000px;width:16px}button.Zebra_DatePicker_Icon.Zebra_DatePicker_Icon_Disabled{background-position:center -32px;cursor:default} -------------------------------------------------------------------------------- /dist/css/default/zebra_datepicker.scss: -------------------------------------------------------------------------------- 1 | @use 'sass:color'; 2 | 3 | $dp_background: #666; 4 | $dp_border_radius: 4px; 5 | $dp_box_shadow: 0px 0px 10px #888; 6 | $dp_color: #222; 7 | $dp_font_size: 13px; 8 | $dp_font_family: Tahoma, Arial, Helvetica, sans-serif; 9 | $dp_padding_width_horizontal: 3px; 10 | $dp_padding_width_vertical: 3px; 11 | 12 | $dp_header_background: $dp_background; 13 | $dp_header_color: #fff; 14 | $dp_header_hover_background: color.adjust($dp_background, $lightness: 15%); 15 | $dp_header_hover_color: $dp_header_color; 16 | $dp_header_padding: 5px; 17 | 18 | $dp_cell_border: 1px solid color.adjust($dp_background, $lightness: 35%); 19 | $dp_cell_hover_background: #88a09e; 20 | $dp_cell_hover_color: #fff; 21 | $dp_cell_min_width: 25px; 22 | $dp_cell_padding: 5px; 23 | 24 | $dp_weekday_background: color.adjust($dp_background, $lightness: 50%); 25 | $dp_weekday_color: $dp_color; 26 | $dp_weekday_disabled_background: color.adjust($dp_background, $lightness: 55%); 27 | $dp_weekday_disabled_color: color.adjust($dp_weekday_disabled_background, $lightness: -15%); 28 | 29 | $dp_weekend_background: color.adjust($dp_background, $lightness: 44%); 30 | $dp_weekend_color: $dp_color; 31 | $dp_weekend_disabled_background: $dp_weekday_disabled_background; 32 | $dp_weekend_disabled_color: $dp_weekday_disabled_color; 33 | 34 | $dp_not_in_month_background: #e0e6f2; 35 | $dp_not_in_month_color: color.adjust($dp_not_in_month_background, $lightness: -20%); 36 | $dp_not_in_month_disabled_background: $dp_weekday_disabled_background; 37 | $dp_not_in_month_disabled_color: $dp_weekday_disabled_color; 38 | 39 | $dp_current_date_color: #cc236b; 40 | $dp_current_date_disabled_color: #b56a6a; 41 | 42 | $dp_selected_date_background: #b56a6a; 43 | $dp_selected_date_color: $dp_cell_hover_color; 44 | 45 | $dp_heading_background: #ffcc33; 46 | $dp_heading_color: $dp_color; 47 | 48 | $dp_time_control_background: $dp_weekday_background; 49 | $dp_time_control_color: $dp_weekday_color; 50 | 51 | $dp_time_background: $dp_weekday_disabled_background; 52 | $dp_time_color: $dp_weekday_color; 53 | $dp_time_separator_color: $dp_cell_border; 54 | 55 | @use "sass:meta"; 56 | @use "sass:math"; 57 | 58 | .Zebra_DatePicker { 59 | background: $dp_background; 60 | @if meta.variable-exists(dp_border) { border: $dp_border; } 61 | @if meta.variable-exists(dp_border_radius) { border-radius: $dp_border_radius; } 62 | @if meta.variable-exists(dp_box_shadow) { box-shadow: $dp_box_shadow; } 63 | color: $dp_color; 64 | font: $dp_font_size $dp_font_family; 65 | padding: $dp_padding_width_vertical $dp_padding_width_horizontal; 66 | position: absolute; 67 | display: table; 68 | z-index: 1200; 69 | 70 | & *, 71 | & *:after, 72 | & *:before { 73 | box-sizing: content-box !important; 74 | } 75 | 76 | & * { 77 | padding: 0; 78 | } 79 | 80 | table { 81 | border-collapse: collapse; 82 | @if meta.variable-exists(dp_border_radius) { border-radius: $dp_border_radius; } 83 | border-spacing: 0; 84 | width: 100%; 85 | } 86 | 87 | th, td { 88 | @if meta.variable-exists(dp_cell_border_radius) { border-radius: $dp_cell_border_radius; } 89 | @if meta.variable-exists(dp_cell_padding) { padding: $dp_cell_padding; } 90 | cursor: pointer; 91 | text-align: center; 92 | min-width: $dp_cell_min_width; 93 | width: $dp_cell_min_width; 94 | } 95 | 96 | .dp_body { 97 | @if meta.variable-exists(dp_cell_border) { 98 | th, td { 99 | border: $dp_cell_border; 100 | &:first-child { 101 | border-left: none; 102 | } 103 | &:last-child { 104 | border-right: none; 105 | } 106 | } 107 | 108 | tr:first-child th, 109 | tr:first-child td { 110 | border-top: none; 111 | } 112 | 113 | tr:last-child th, 114 | tr:last-child td { 115 | border-bottom: none; 116 | } 117 | } 118 | 119 | td { 120 | @if meta.variable-exists(dp_weekday_background) and $dp_weekday_background != $dp_background { background: $dp_weekday_background; } 121 | @if meta.variable-exists(dp_weekday_color) and $dp_weekday_color != $dp_color { color: $dp_weekday_color; } 122 | } 123 | 124 | .dp_weekend { 125 | @if meta.variable-exists(dp_weekend_background) and $dp_weekend_background != (if(meta.variable_exists(dp_weekday_background), $dp_weekday_background, $dp_background)) { background: $dp_weekend_background; } 126 | @if meta.variable-exists(dp_weekend_color) and $dp_weekend_color != (if(meta.variable_exists(dp_weekday_color), $dp_weekday_color, $dp_color)) { color: $dp_weekend_color; } 127 | } 128 | 129 | .dp_not_in_month { 130 | @if meta.variable-exists(dp_not_in_month_background) and $dp_not_in_month_background != (if(meta.variable_exists(dp_weekday_background), $dp_weekday_background, $dp_background)) { background: $dp_not_in_month_background; } 131 | @if meta.variable-exists(dp_not_in_month_color) and $dp_not_in_month_color != (if(meta.variable_exists(dp_weekday_color), $dp_weekday_color, $dp_color)) { color: $dp_not_in_month_color; } 132 | } 133 | .dp_time_control { 134 | @if meta.variable-exists(dp_time_control_background) and $dp_time_control_background != $dp_weekday_background { background: $dp_time_control_background; } 135 | @if meta.variable-exists(dp_time_control_color) and $dp_time_control_color != $dp_weekday_color { background: $dp_time_control_color; } 136 | } 137 | 138 | .dp_time_controls_condensed { 139 | td { 140 | width: 25%; 141 | } 142 | } 143 | 144 | .dp_current { 145 | @if meta.variable-exists(dp_current_date_background) and $dp_current_date_background != $dp_background { background: $dp_current_date_background; } 146 | @if meta.variable-exists(dp_current_date_color) and $dp_current_date_color != $dp_color { color: $dp_current_date_color; } 147 | } 148 | 149 | .dp_selected { 150 | @if meta.variable-exists(dp_selected_date_background) and $dp_selected_date_background != $dp_background { background: $dp_selected_date_background; } 151 | @if meta.variable-exists(dp_selected_date_color) { color: $dp_selected_date_color; } 152 | } 153 | 154 | .dp_disabled { 155 | @if meta.variable-exists(dp_weekday_disabled_background) and $dp_weekday_disabled_background != $dp_background { background: $dp_weekday_disabled_background; } 156 | @if meta.variable-exists(dp_weekday_disabled_color) and $dp_weekday_disabled_color != $dp_color { color: $dp_weekday_disabled_color; } 157 | cursor: text; 158 | 159 | &.dp_not_in_month { 160 | @if meta.variable-exists(dp_not_in_month_disabled_background) and $dp_not_in_month_disabled_background != (if(meta.variable_exists(dp_weekday_disabled_background), $dp_weekday_disabled_background, $dp_background)) { background: $dp_not_in_month_disabled_background; } 161 | @if meta.variable-exists(dp_not_in_month_disabled_color) and $dp_not_in_month_disabled_color != (if(meta.variable_exists(dp_weekday_disabled_color), $dp_weekday_disabled_color, $dp_color)) { color: $dp_not_in_month_disabled_color; } 162 | } 163 | 164 | &.dp_weekend { 165 | @if meta.variable-exists(dp_weekend_disabled_background) and $dp_weekend_disabled_background != (if(meta.variable_exists(dp_weekday_disabled_background), $dp_weekday_disabled_background, $dp_background)) { background: $dp_weekend_disabled_background; } 166 | @if meta.variable-exists(dp_weekend_disabled_color) and $dp_weekend_disabled_color != (if(meta.variable_exists(dp_weekday_disabled_color), $dp_weekday_disabled_color, $dp_color)) { color: $dp_weekend_disabled_color; } 167 | } 168 | 169 | &.dp_current { 170 | @if meta.variable-exists(dp_current_date_disabled_background) and $dp_current_date_disabled_background != (if(meta.variable_exists(dp_weekday_disabled_background), $dp_weekday_disabled_background, $dp_background)) { background: $dp_current_date_disabled_background; } 171 | @if meta.variable-exists(dp_current_date_disabled_color) and $dp_current_date_disabled_color != (if(meta.variable_exists(dp_weekday_disabled_color), $dp_weekday_disabled_color, $dp_color)) { color: $dp_current_date_disabled_color; } 172 | } 173 | } 174 | 175 | @media (hover: hover) { 176 | .dp_hover { 177 | @if meta.variable-exists(dp_cell_hover_color) { color: $dp_cell_hover_color; } 178 | @if meta.variable-exists(dp_cell_hover_background) { background: $dp_cell_hover_background; } 179 | &.dp_time_control { 180 | @if meta.variable-exists(dp_header_hover_background) and $dp_header_hover_background != $dp_background { background-color: $dp_header_hover_background; } 181 | @if meta.variable-exists(dp_header_hover_color) and $dp_header_hover_color != $dp_color { color: $dp_header_hover_color; } 182 | } 183 | } 184 | } 185 | 186 | } 187 | 188 | .dp_monthpicker, 189 | .dp_yearpicker, 190 | .dp_timepicker { 191 | td { 192 | width: 33.3333%; 193 | } 194 | } 195 | 196 | .dp_timepicker .dp_disabled { 197 | @if meta.variable-exists(dp_time_background) and $dp_time_background != $dp_weekday_disabled_background { background: $dp_time_background; } 198 | border: none; 199 | color: if(meta.variable-exists(dp_time_color), $dp_time_color, if(meta.variable-exists(dp_weekday_color), $dp_weekday_color, $dp_color)); 200 | font-size: math.ceil($dp_font_size * 2); 201 | font-weight: bold; 202 | } 203 | 204 | .dp_time_separator { 205 | div { 206 | position: relative; 207 | &:after { 208 | content: ":"; 209 | color: if(meta.variable-exists(dp_time_separator_color), $dp_time_separator_color, if(meta.variable-exists(dp_weekday_color), $dp_weekday_color, $dp_color)); 210 | font-size: math.ceil($dp_font_size * 1.5); 211 | left: 100%; 212 | margin-left: 2px; 213 | margin-top: -$dp_font_size; 214 | position: absolute; 215 | top: 50%; 216 | z-index: 1; 217 | } 218 | } 219 | } 220 | 221 | .dp_header { 222 | @if meta.variable-exists(dp_padding_width_vertical) { margin-bottom: $dp_padding_width_vertical; } 223 | 224 | // fix for Edge replacing ◀ and ▶ Unicode symbols with emojis 225 | // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11844964/ 226 | @supports (-ms-ime-align:auto) { 227 | font-family: 'Segoe UI Symbol', Tahoma, Arial, Helvetica, sans-serif; 228 | } 229 | } 230 | 231 | .dp_footer { 232 | @if meta.variable-exists(dp_padding_width_vertical) { margin-top: $dp_padding_width_vertical; } 233 | .dp_icon { 234 | width: 50%; 235 | } 236 | } 237 | 238 | .dp_actions { 239 | td { 240 | @if meta.variable-exists(dp_header_background) and $dp_header_background != $dp_background { background: $dp_header_background; } 241 | @if meta.variable-exists(dp_border_radius) { border-radius: $dp_border_radius; } 242 | @if meta.variable-exists(dp_header_color) and $dp_header_color != $dp_color { color: $dp_header_color; } 243 | @if meta.variable-exists(dp_header_padding) and $dp_header_padding != $dp_cell_padding { padding: $dp_header_padding; } 244 | } 245 | 246 | .dp_caption { 247 | font-weight: bold; 248 | width: 100%; 249 | } 250 | 251 | @media (hover: hover) { 252 | .dp_hover { 253 | @if meta.variable-exists(dp_header_hover_background) and $dp_header_hover_background != $dp_background { background-color: $dp_header_hover_background; } 254 | @if meta.variable-exists(dp_header_hover_color) and $dp_header_hover_color != $dp_color { color: $dp_header_hover_color; } 255 | } 256 | } 257 | } 258 | 259 | .dp_daypicker th { 260 | @if meta.variable-exists(dp_heading_background) and $dp_heading_background != $dp_background { background: $dp_heading_background; } 261 | @if meta.variable-exists(dp_heading_color) and $dp_heading_color != $dp_color { color: $dp_heading_color; } 262 | cursor: text; 263 | font-weight: bold; 264 | } 265 | 266 | &.dp_hidden { 267 | display: none; 268 | } 269 | 270 | .dp_icon { 271 | height: 16px; 272 | background-image: url('icons.png'); 273 | background-repeat: no-repeat; 274 | text-indent: -9999px; 275 | 276 | &.dp_confirm { 277 | background-position: center -#{128 - $dp_header_padding}; 278 | } 279 | 280 | &.dp_view_toggler { 281 | background-position: center -#{96 - $dp_header_padding}; 282 | 283 | &.dp_calendar { 284 | background-position: center -#{64 - $dp_header_padding}; 285 | } 286 | } 287 | } 288 | } 289 | 290 | button.Zebra_DatePicker_Icon { 291 | background: url('icons.png') no-repeat center top; 292 | border: none; 293 | cursor: pointer; 294 | display: block; 295 | height: 16px; 296 | line-height: 0; 297 | padding: 0; 298 | position: absolute; 299 | text-indent: -9000px; 300 | width: 16px; 301 | 302 | &.Zebra_DatePicker_Icon_Disabled { 303 | background-position: center -32px; 304 | cursor: default; 305 | } 306 | } 307 | 308 | -------------------------------------------------------------------------------- /dist/css/metallic/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefangabos/Zebra_Datepicker/881d1a6023d4d7cd265d9baa5e6420934c721863/dist/css/metallic/icons.png -------------------------------------------------------------------------------- /dist/css/metallic/zebra_datepicker.css: -------------------------------------------------------------------------------- 1 | .Zebra_DatePicker { 2 | background: #373737; 3 | border-radius: 4px; 4 | box-shadow: 0 0 10px #888; 5 | color: #fff; 6 | font: 13px Tahoma,Arial,Helvetica,sans-serif; 7 | padding: 3px; 8 | position: absolute; 9 | display: table; 10 | z-index: 1200 11 | } 12 | .Zebra_DatePicker *, 13 | .Zebra_DatePicker :after, 14 | .Zebra_DatePicker :before { 15 | box-sizing: content-box!important 16 | } 17 | .Zebra_DatePicker * { 18 | padding: 0 19 | } 20 | .Zebra_DatePicker table { 21 | border-collapse: collapse; 22 | border-radius: 4px; 23 | border-spacing: 0; 24 | width: 100% 25 | } 26 | .Zebra_DatePicker td, 27 | .Zebra_DatePicker th { 28 | padding: 5px; 29 | cursor: pointer; 30 | text-align: center; 31 | min-width: 25px; 32 | width: 25px 33 | } 34 | .Zebra_DatePicker .dp_body td, 35 | .Zebra_DatePicker .dp_body th { 36 | border: 1px solid #bbb 37 | } 38 | .Zebra_DatePicker .dp_body td:first-child, 39 | .Zebra_DatePicker .dp_body th:first-child { 40 | border-left: none 41 | } 42 | .Zebra_DatePicker .dp_body td:last-child, 43 | .Zebra_DatePicker .dp_body th:last-child { 44 | border-right: none 45 | } 46 | .Zebra_DatePicker .dp_body tr:first-child td, 47 | .Zebra_DatePicker .dp_body tr:first-child th { 48 | border-top: none 49 | } 50 | .Zebra_DatePicker .dp_body tr:last-child td, 51 | .Zebra_DatePicker .dp_body tr:last-child th { 52 | border-bottom: none 53 | } 54 | .Zebra_DatePicker .dp_body td { 55 | background: #dedede; 56 | color: #666 57 | } 58 | .Zebra_DatePicker .dp_body .dp_weekend { 59 | background: #d1d1d1 60 | } 61 | .Zebra_DatePicker .dp_body .dp_not_in_month { 62 | background: #eaeaea 63 | } 64 | .Zebra_DatePicker .dp_body .dp_time_controls_condensed td { 65 | width: 25% 66 | } 67 | .Zebra_DatePicker .dp_body .dp_current { 68 | color: #e26261 69 | } 70 | .Zebra_DatePicker .dp_body .dp_selected { 71 | background: #e26262; 72 | color: #fff 73 | } 74 | .Zebra_DatePicker .dp_body .dp_disabled { 75 | background: #ececec; 76 | color: #ccc; 77 | cursor: text 78 | } 79 | .Zebra_DatePicker .dp_body .dp_disabled.dp_current { 80 | color: #f5cdcc 81 | } 82 | @media (hover:hover) { 83 | .Zebra_DatePicker .dp_body .dp_hover { 84 | color: #fff; 85 | background: #67aabb 86 | } 87 | .Zebra_DatePicker .dp_actions .dp_hover, 88 | .Zebra_DatePicker .dp_body .dp_hover.dp_time_control { 89 | background-color: #5d5d5d 90 | } 91 | } 92 | .Zebra_DatePicker .dp_monthpicker td, 93 | .Zebra_DatePicker .dp_timepicker td, 94 | .Zebra_DatePicker .dp_yearpicker td { 95 | width: 33.3333% 96 | } 97 | .Zebra_DatePicker .dp_timepicker .dp_disabled { 98 | border: none; 99 | color: #666; 100 | font-size: 26px; 101 | font-weight: 700 102 | } 103 | .Zebra_DatePicker .dp_time_separator div { 104 | position: relative 105 | } 106 | .Zebra_DatePicker .dp_time_separator div:after { 107 | content: ":"; 108 | color: 1px solid #bbb; 109 | font-size: 20px; 110 | left: 100%; 111 | margin-left: 2px; 112 | margin-top: -13px; 113 | position: absolute; 114 | top: 50%; 115 | z-index: 1 116 | } 117 | .Zebra_DatePicker .dp_header { 118 | margin-bottom: 3px 119 | } 120 | @supports (-ms-ime-align:auto) { 121 | .Zebra_DatePicker .dp_header { 122 | font-family: "Segoe UI Symbol",Tahoma,Arial,Helvetica,sans-serif 123 | } 124 | } 125 | .Zebra_DatePicker .dp_footer { 126 | margin-top: 3px 127 | } 128 | .Zebra_DatePicker .dp_footer .dp_icon { 129 | width: 50% 130 | } 131 | .Zebra_DatePicker .dp_actions td { 132 | border-radius: 4px 133 | } 134 | .Zebra_DatePicker .dp_actions .dp_caption { 135 | font-weight: 700; 136 | width: 100% 137 | } 138 | .Zebra_DatePicker .dp_daypicker th { 139 | background: #f1f1f1; 140 | color: #666; 141 | cursor: text; 142 | font-weight: 700 143 | } 144 | .Zebra_DatePicker.dp_hidden { 145 | display: none 146 | } 147 | .Zebra_DatePicker .dp_icon { 148 | height: 16px; 149 | background-image: url("icons.png"); 150 | background-repeat: no-repeat; 151 | text-indent: -9999px 152 | } 153 | .Zebra_DatePicker .dp_icon.dp_confirm { 154 | background-position: center -123px 155 | } 156 | .Zebra_DatePicker .dp_icon.dp_view_toggler { 157 | background-position: center -91px 158 | } 159 | .Zebra_DatePicker .dp_icon.dp_view_toggler.dp_calendar { 160 | background-position: center -59px 161 | } 162 | button.Zebra_DatePicker_Icon { 163 | background: url("icons.png") center top no-repeat; 164 | border: none; 165 | cursor: pointer; 166 | display: block; 167 | height: 16px; 168 | line-height: 0; 169 | padding: 0; 170 | position: absolute; 171 | text-indent: -9000px; 172 | width: 16px 173 | } 174 | button.Zebra_DatePicker_Icon.Zebra_DatePicker_Icon_Disabled { 175 | background-position: center -32px; 176 | cursor: default 177 | } -------------------------------------------------------------------------------- /dist/css/metallic/zebra_datepicker.min.css: -------------------------------------------------------------------------------- 1 | .Zebra_DatePicker{background:#373737;border-radius:4px;box-shadow:0 0 10px #888;color:#fff;font:13px Tahoma,Arial,Helvetica,sans-serif;padding:3px;position:absolute;display:table;z-index:1200}.Zebra_DatePicker *,.Zebra_DatePicker :after,.Zebra_DatePicker :before{box-sizing:content-box!important}.Zebra_DatePicker *{padding:0}.Zebra_DatePicker table{border-collapse:collapse;border-radius:4px;border-spacing:0;width:100%}.Zebra_DatePicker td,.Zebra_DatePicker th{padding:5px;cursor:pointer;text-align:center;min-width:25px;width:25px}.Zebra_DatePicker .dp_body td,.Zebra_DatePicker .dp_body th{border:1px solid #bbb}.Zebra_DatePicker .dp_body td:first-child,.Zebra_DatePicker .dp_body th:first-child{border-left:none}.Zebra_DatePicker .dp_body td:last-child,.Zebra_DatePicker .dp_body th:last-child{border-right:none}.Zebra_DatePicker .dp_body tr:first-child td,.Zebra_DatePicker .dp_body tr:first-child th{border-top:none}.Zebra_DatePicker .dp_body tr:last-child td,.Zebra_DatePicker .dp_body tr:last-child th{border-bottom:none}.Zebra_DatePicker .dp_body td{background:#dedede;color:#666}.Zebra_DatePicker .dp_body .dp_weekend{background:#d1d1d1}.Zebra_DatePicker .dp_body .dp_not_in_month{background:#eaeaea}.Zebra_DatePicker .dp_body .dp_time_controls_condensed td{width:25%}.Zebra_DatePicker .dp_body .dp_current{color:#e26261}.Zebra_DatePicker .dp_body .dp_selected{background:#e26262;color:#fff}.Zebra_DatePicker .dp_body .dp_disabled{background:#ececec;color:#ccc;cursor:text}.Zebra_DatePicker .dp_body .dp_disabled.dp_current{color:#f5cbcb}@media(hover:hover){.Zebra_DatePicker .dp_body .dp_hover{color:#fff;background:#67aabb}.Zebra_DatePicker .dp_actions .dp_hover,.Zebra_DatePicker .dp_body .dp_hover.dp_time_control{background-color:#5d5d5d}}.Zebra_DatePicker .dp_monthpicker td,.Zebra_DatePicker .dp_timepicker td,.Zebra_DatePicker .dp_yearpicker td{width:33.3333%}.Zebra_DatePicker .dp_timepicker .dp_disabled{border:none;color:#666;font-size:26px;font-weight:700}.Zebra_DatePicker .dp_time_separator div{position:relative}.Zebra_DatePicker .dp_time_separator div:after{content:":";color:1px solid #bbb;font-size:20px;left:100%;margin-left:2px;margin-top:-13px;position:absolute;top:50%;z-index:1}.Zebra_DatePicker .dp_header{margin-bottom:3px}@supports(-ms-ime-align:auto){.Zebra_DatePicker .dp_header{font-family:"Segoe UI Symbol",Tahoma,Arial,Helvetica,sans-serif}}.Zebra_DatePicker .dp_footer{margin-top:3px}.Zebra_DatePicker .dp_footer .dp_icon{width:50%}.Zebra_DatePicker .dp_actions td{border-radius:4px}.Zebra_DatePicker .dp_actions .dp_caption{font-weight:700;width:100%}.Zebra_DatePicker .dp_daypicker th{background:#f1f1f1;color:#666;cursor:text;font-weight:700}.Zebra_DatePicker.dp_hidden{display:none}.Zebra_DatePicker .dp_icon{height:16px;background-image:url("icons.png");background-repeat:no-repeat;text-indent:-9999px}.Zebra_DatePicker .dp_icon.dp_confirm{background-position:center -123px}.Zebra_DatePicker .dp_icon.dp_view_toggler{background-position:center -91px}.Zebra_DatePicker .dp_icon.dp_view_toggler.dp_calendar{background-position:center -59px}button.Zebra_DatePicker_Icon{background:url("icons.png") center top no-repeat;border:none;cursor:pointer;display:block;height:16px;line-height:0;padding:0;position:absolute;text-indent:-9000px;width:16px}button.Zebra_DatePicker_Icon.Zebra_DatePicker_Icon_Disabled{background-position:center -32px;cursor:default} -------------------------------------------------------------------------------- /dist/css/metallic/zebra_datepicker.scss: -------------------------------------------------------------------------------- 1 | @use 'sass:color'; 2 | 3 | $dp_background: #373737; 4 | $dp_border_radius: 4px; 5 | $dp_box_shadow: 0px 0px 10px #888; 6 | $dp_color: #fff; 7 | $dp_font_size: 13px; 8 | $dp_font_family: Tahoma, Arial, Helvetica, sans-serif; 9 | $dp_padding_width_horizontal: 3px; 10 | $dp_padding_width_vertical: 3px; 11 | 12 | $dp_header_hover_background: color.adjust($dp_background, $lightness: 15%); 13 | $dp_header_padding: 5px; 14 | 15 | $dp_cell_border: 1px solid #bbb; 16 | $dp_cell_hover_background: #67aabb; 17 | $dp_cell_hover_color: #fff; 18 | $dp_cell_min_width: 25px; 19 | $dp_cell_padding: 5px; 20 | 21 | $dp_weekday_background: #dedede; 22 | $dp_weekday_color: #666; 23 | $dp_weekday_disabled_background: #ececec; 24 | $dp_weekday_disabled_color: #ccc; 25 | 26 | $dp_weekend_background: color.adjust($dp_weekday_background, $lightness: -5%); 27 | $dp_weekend_color: $dp_weekday_color; 28 | $dp_weekend_disabled_background: $dp_weekday_disabled_background; 29 | $dp_weekend_disabled_color: $dp_weekday_disabled_color; 30 | 31 | $dp_not_in_month_background: color.adjust($dp_weekday_background, $lightness: 5%); 32 | $dp_not_in_month_color: $dp_weekday_color; 33 | $dp_not_in_month_disabled_background: $dp_weekday_disabled_background; 34 | $dp_not_in_month_disabled_color: $dp_weekday_disabled_color; 35 | 36 | $dp_current_date_color: #e26261; 37 | $dp_current_date_disabled_color: color.adjust($dp_current_date_color, $lightness: 25%); 38 | 39 | $dp_selected_date_background: #e26262; 40 | $dp_selected_date_color: $dp_cell_hover_color; 41 | 42 | $dp_heading_background: #f1f1f1; 43 | $dp_heading_color: #666; 44 | 45 | $dp_time_control_background: $dp_weekday_background; 46 | $dp_time_control_color: $dp_weekday_color; 47 | 48 | $dp_time_background: $dp_weekday_disabled_background; 49 | $dp_time_color: $dp_weekday_color; 50 | $dp_time_separator_color: $dp_cell_border; 51 | 52 | @use "sass:meta"; 53 | @use "sass:math"; 54 | 55 | .Zebra_DatePicker { 56 | background: $dp_background; 57 | @if meta.variable-exists(dp_border) { border: $dp_border; } 58 | @if meta.variable-exists(dp_border_radius) { border-radius: $dp_border_radius; } 59 | @if meta.variable-exists(dp_box_shadow) { box-shadow: $dp_box_shadow; } 60 | color: $dp_color; 61 | font: $dp_font_size $dp_font_family; 62 | padding: $dp_padding_width_vertical $dp_padding_width_horizontal; 63 | position: absolute; 64 | display: table; 65 | z-index: 1200; 66 | 67 | & *, 68 | & *:after, 69 | & *:before { 70 | box-sizing: content-box !important; 71 | } 72 | 73 | & * { 74 | padding: 0; 75 | } 76 | 77 | table { 78 | border-collapse: collapse; 79 | @if meta.variable-exists(dp_border_radius) { border-radius: $dp_border_radius; } 80 | border-spacing: 0; 81 | width: 100%; 82 | } 83 | 84 | th, td { 85 | @if meta.variable-exists(dp_cell_border_radius) { border-radius: $dp_cell_border_radius; } 86 | @if meta.variable-exists(dp_cell_padding) { padding: $dp_cell_padding; } 87 | cursor: pointer; 88 | text-align: center; 89 | min-width: $dp_cell_min_width; 90 | width: $dp_cell_min_width; 91 | } 92 | 93 | .dp_body { 94 | @if meta.variable-exists(dp_cell_border) { 95 | th, td { 96 | border: $dp_cell_border; 97 | &:first-child { 98 | border-left: none; 99 | } 100 | &:last-child { 101 | border-right: none; 102 | } 103 | } 104 | 105 | tr:first-child th, 106 | tr:first-child td { 107 | border-top: none; 108 | } 109 | 110 | tr:last-child th, 111 | tr:last-child td { 112 | border-bottom: none; 113 | } 114 | } 115 | 116 | td { 117 | @if meta.variable-exists(dp_weekday_background) and $dp_weekday_background != $dp_background { background: $dp_weekday_background; } 118 | @if meta.variable-exists(dp_weekday_color) and $dp_weekday_color != $dp_color { color: $dp_weekday_color; } 119 | } 120 | 121 | .dp_weekend { 122 | @if meta.variable-exists(dp_weekend_background) and $dp_weekend_background != (if(meta.variable_exists(dp_weekday_background), $dp_weekday_background, $dp_background)) { background: $dp_weekend_background; } 123 | @if meta.variable-exists(dp_weekend_color) and $dp_weekend_color != (if(meta.variable_exists(dp_weekday_color), $dp_weekday_color, $dp_color)) { color: $dp_weekend_color; } 124 | } 125 | 126 | .dp_not_in_month { 127 | @if meta.variable-exists(dp_not_in_month_background) and $dp_not_in_month_background != (if(meta.variable_exists(dp_weekday_background), $dp_weekday_background, $dp_background)) { background: $dp_not_in_month_background; } 128 | @if meta.variable-exists(dp_not_in_month_color) and $dp_not_in_month_color != (if(meta.variable_exists(dp_weekday_color), $dp_weekday_color, $dp_color)) { color: $dp_not_in_month_color; } 129 | } 130 | .dp_time_control { 131 | @if meta.variable-exists(dp_time_control_background) and $dp_time_control_background != $dp_weekday_background { background: $dp_time_control_background; } 132 | @if meta.variable-exists(dp_time_control_color) and $dp_time_control_color != $dp_weekday_color { background: $dp_time_control_color; } 133 | } 134 | 135 | .dp_time_controls_condensed { 136 | td { 137 | width: 25%; 138 | } 139 | } 140 | 141 | .dp_current { 142 | @if meta.variable-exists(dp_current_date_background) and $dp_current_date_background != $dp_background { background: $dp_current_date_background; } 143 | @if meta.variable-exists(dp_current_date_color) and $dp_current_date_color != $dp_color { color: $dp_current_date_color; } 144 | } 145 | 146 | .dp_selected { 147 | @if meta.variable-exists(dp_selected_date_background) and $dp_selected_date_background != $dp_background { background: $dp_selected_date_background; } 148 | @if meta.variable-exists(dp_selected_date_color) { color: $dp_selected_date_color; } 149 | } 150 | 151 | .dp_disabled { 152 | @if meta.variable-exists(dp_weekday_disabled_background) and $dp_weekday_disabled_background != $dp_background { background: $dp_weekday_disabled_background; } 153 | @if meta.variable-exists(dp_weekday_disabled_color) and $dp_weekday_disabled_color != $dp_color { color: $dp_weekday_disabled_color; } 154 | cursor: text; 155 | 156 | &.dp_not_in_month { 157 | @if meta.variable-exists(dp_not_in_month_disabled_background) and $dp_not_in_month_disabled_background != (if(meta.variable_exists(dp_weekday_disabled_background), $dp_weekday_disabled_background, $dp_background)) { background: $dp_not_in_month_disabled_background; } 158 | @if meta.variable-exists(dp_not_in_month_disabled_color) and $dp_not_in_month_disabled_color != (if(meta.variable_exists(dp_weekday_disabled_color), $dp_weekday_disabled_color, $dp_color)) { color: $dp_not_in_month_disabled_color; } 159 | } 160 | 161 | &.dp_weekend { 162 | @if meta.variable-exists(dp_weekend_disabled_background) and $dp_weekend_disabled_background != (if(meta.variable_exists(dp_weekday_disabled_background), $dp_weekday_disabled_background, $dp_background)) { background: $dp_weekend_disabled_background; } 163 | @if meta.variable-exists(dp_weekend_disabled_color) and $dp_weekend_disabled_color != (if(meta.variable_exists(dp_weekday_disabled_color), $dp_weekday_disabled_color, $dp_color)) { color: $dp_weekend_disabled_color; } 164 | } 165 | 166 | &.dp_current { 167 | @if meta.variable-exists(dp_current_date_disabled_background) and $dp_current_date_disabled_background != (if(meta.variable_exists(dp_weekday_disabled_background), $dp_weekday_disabled_background, $dp_background)) { background: $dp_current_date_disabled_background; } 168 | @if meta.variable-exists(dp_current_date_disabled_color) and $dp_current_date_disabled_color != (if(meta.variable_exists(dp_weekday_disabled_color), $dp_weekday_disabled_color, $dp_color)) { color: $dp_current_date_disabled_color; } 169 | } 170 | } 171 | 172 | @media (hover: hover) { 173 | .dp_hover { 174 | @if meta.variable-exists(dp_cell_hover_color) { color: $dp_cell_hover_color; } 175 | @if meta.variable-exists(dp_cell_hover_background) { background: $dp_cell_hover_background; } 176 | &.dp_time_control { 177 | @if meta.variable-exists(dp_header_hover_background) and $dp_header_hover_background != $dp_background { background-color: $dp_header_hover_background; } 178 | @if meta.variable-exists(dp_header_hover_color) and $dp_header_hover_color != $dp_color { color: $dp_header_hover_color; } 179 | } 180 | } 181 | } 182 | 183 | } 184 | 185 | .dp_monthpicker, 186 | .dp_yearpicker, 187 | .dp_timepicker { 188 | td { 189 | width: 33.3333%; 190 | } 191 | } 192 | 193 | .dp_timepicker .dp_disabled { 194 | @if meta.variable-exists(dp_time_background) and $dp_time_background != $dp_weekday_disabled_background { background: $dp_time_background; } 195 | border: none; 196 | color: if(meta.variable-exists(dp_time_color), $dp_time_color, if(meta.variable-exists(dp_weekday_color), $dp_weekday_color, $dp_color)); 197 | font-size: math.ceil($dp_font_size * 2); 198 | font-weight: bold; 199 | } 200 | 201 | .dp_time_separator { 202 | div { 203 | position: relative; 204 | &:after { 205 | content: ":"; 206 | color: if(meta.variable-exists(dp_time_separator_color), $dp_time_separator_color, if(meta.variable-exists(dp_weekday_color), $dp_weekday_color, $dp_color)); 207 | font-size: math.ceil($dp_font_size * 1.5); 208 | left: 100%; 209 | margin-left: 2px; 210 | margin-top: -$dp_font_size; 211 | position: absolute; 212 | top: 50%; 213 | z-index: 1; 214 | } 215 | } 216 | } 217 | 218 | .dp_header { 219 | @if meta.variable-exists(dp_padding_width_vertical) { margin-bottom: $dp_padding_width_vertical; } 220 | 221 | // fix for Edge replacing ◀ and ▶ Unicode symbols with emojis 222 | // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11844964/ 223 | @supports (-ms-ime-align:auto) { 224 | font-family: 'Segoe UI Symbol', Tahoma, Arial, Helvetica, sans-serif; 225 | } 226 | } 227 | 228 | .dp_footer { 229 | @if meta.variable-exists(dp_padding_width_vertical) { margin-top: $dp_padding_width_vertical; } 230 | .dp_icon { 231 | width: 50%; 232 | } 233 | } 234 | 235 | .dp_actions { 236 | td { 237 | @if meta.variable-exists(dp_header_background) and $dp_header_background != $dp_background { background: $dp_header_background; } 238 | @if meta.variable-exists(dp_border_radius) { border-radius: $dp_border_radius; } 239 | @if meta.variable-exists(dp_header_color) and $dp_header_color != $dp_color { color: $dp_header_color; } 240 | @if meta.variable-exists(dp_header_padding) and $dp_header_padding != $dp_cell_padding { padding: $dp_header_padding; } 241 | } 242 | 243 | .dp_caption { 244 | font-weight: bold; 245 | width: 100%; 246 | } 247 | 248 | @media (hover: hover) { 249 | .dp_hover { 250 | @if meta.variable-exists(dp_header_hover_background) and $dp_header_hover_background != $dp_background { background-color: $dp_header_hover_background; } 251 | @if meta.variable-exists(dp_header_hover_color) and $dp_header_hover_color != $dp_color { color: $dp_header_hover_color; } 252 | } 253 | } 254 | } 255 | 256 | .dp_daypicker th { 257 | @if meta.variable-exists(dp_heading_background) and $dp_heading_background != $dp_background { background: $dp_heading_background; } 258 | @if meta.variable-exists(dp_heading_color) and $dp_heading_color != $dp_color { color: $dp_heading_color; } 259 | cursor: text; 260 | font-weight: bold; 261 | } 262 | 263 | &.dp_hidden { 264 | display: none; 265 | } 266 | 267 | .dp_icon { 268 | height: 16px; 269 | background-image: url('icons.png'); 270 | background-repeat: no-repeat; 271 | text-indent: -9999px; 272 | 273 | &.dp_confirm { 274 | background-position: center -#{128 - $dp_header_padding}; 275 | } 276 | 277 | &.dp_view_toggler { 278 | background-position: center -#{96 - $dp_header_padding}; 279 | 280 | &.dp_calendar { 281 | background-position: center -#{64 - $dp_header_padding}; 282 | } 283 | } 284 | } 285 | } 286 | 287 | button.Zebra_DatePicker_Icon { 288 | background: url('icons.png') no-repeat center top; 289 | border: none; 290 | cursor: pointer; 291 | display: block; 292 | height: 16px; 293 | line-height: 0; 294 | padding: 0; 295 | position: absolute; 296 | text-indent: -9000px; 297 | width: 16px; 298 | 299 | &.Zebra_DatePicker_Icon_Disabled { 300 | background-position: center -32px; 301 | cursor: default; 302 | } 303 | } 304 | 305 | -------------------------------------------------------------------------------- /dist/zebra_datepicker.min.js: -------------------------------------------------------------------------------- 1 | !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(xt){"use strict";xt.Zebra_DatePicker=function(t,K){var m,X,f,tt,et,st,b,y,v,p,w,nt,k,A,it,D,C,M,P,at,F,Z,rt,ot,dt,x,d,S,ct,lt,Y,I,j,O,z,gt,H,_t,N,L,T,c,R,B,W,ht={always_visible:!(this.version="2.2.0"),container:xt("body"),current_date:!1,custom_classes:!1,days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],days_abbr:!1,default_position:"icon_top_right",direction:0,disable_time_picker:!1,disabled_dates:!1,enabled_ampm:!1,enabled_dates:!1,enabled_hours:!1,enabled_minutes:!1,enabled_seconds:!1,fast_navigation:!0,first_day_of_week:1,format:"Y-m-d",header_captions:{days:"F, Y",months:"Y",years:"Y1 - Y2"},icon_margin:!1,icon_position:"right",inside:!0,lang_clear_date:"Clear date",months:["January","February","March","April","May","June","July","August","September","October","November","December"],months_abbr:!1,navigation:["◀","▶","▲","▼"],offset:[5,-5],open_icon_only:!1,open_on_focus:!1,pair:!1,readonly_element:!0,rtl:!1,select_other_months:!1,show_clear_date:0,show_icon:"Pick a date",show_other_months:!0,show_select_today:"Today",show_week_number:!1,start_date:!1,strict:!1,view:"days",weekend_days:[0,6],zero_pad:!1,onChange:null,onClear:null,onOpen:null,onClose:null,onSelect:null},pt={},E={},ut=!1,Q="",mt=!1,ft=!1,bt=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),J=this,G=xt(t),e=function(t){for(var e,s,a,n,i={days:["d","j","D"],months:["F","m","M","n","t"],years:["o","Y","y"],hours:["G","g","H","h"],minutes:["i"],seconds:["s"],ampm:["A","a"]},r=null,o=!1,d=0;d<3;d++)Q+=Math.floor(65536*(1+Math.random())).toString(16);if(A=[],it=[],!t)for(e in J.settings=xt.extend({},ht,xt.fn.Zebra_DatePicker.defaults,K),E.readonly=G.attr("readonly"),E.style=G.attr("style"),E.padding_left=parseInt(G.css("paddingLeft"),10)||0,E.padding_right=parseInt(G.css("paddingRight"),10)||0,G.data())0===e.indexOf("zdp_")&&(e=e.replace(/^zdp\_/,""),undefined!==ht[e])&&(J.settings[e]="pair"===e?xt(G.data("zdp_"+e)):G.data("zdp_"+e));for(J.settings.readonly_element?G.attr("readonly","readonly"):G.removeAttr("readonly"),L=!1,B=[];!o;){for(r in i)xt.each(i[r],function(t,e){var s,n;if(-1').css({display:G.css("display"),position:"static"===G.css("position")?"relative":G.css("position"),"float":G.css("float"),top:G.css("top"),right:G.css("right"),bottom:G.css("bottom"),left:G.css("left"),marginTop:u<0?u:0,marginRight:h<0?h:0,marginBottom:l<0?l:0,marginLeft:p<0?p:0,paddingTop:u,paddingRight:h,paddingBottom:l,paddingLeft:p}),G.wrap(u).css({position:"relative","float":"none",top:"auto",right:"auto",bottom:"auto",left:"auto",marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),Z=xt('"),J.icon=Z,J.settings.open_icon_only?Z:Z.add(G)):G).on("click.Zebra_DatePicker_"+Q+(J.settings.open_on_focus?" focus.Zebra_DatePicker_"+Q:""),function(t){y.hasClass("dp_hidden")&&!G.attr("disabled")&&(mt&&!J.settings.readonly_element&&(ft=!1,clearTimeout(_t),xt(t.target).is('input[type="text"]'))?(ft=!0,_t=setTimeout(function(){J.show()},600)):J.show())}),X.on("keydown.Zebra_DatePicker_"+Q,function(t){9!==t.keyCode||y.hasClass("dp_hidden")||J.hide()}),!J.settings.readonly_element&&J.settings.pair&&G.on("blur.Zebra_DatePicker_"+Q,function(){var t;(t=yt(xt(this).val()))&&!U(t.getFullYear(),t.getMonth(),t.getDate())&&Ft(t)}),undefined!==Z&&Z.insertAfter(G)),undefined!==Z&&(Z.attr("style",""),h=G.outerWidth(),l=G.outerHeight(),p=Z.outerWidth(),u=Z.outerHeight(),Z.css("top",(l-u)/2),J.settings.inside?"right"===J.settings.icon_position?(Z.css("right",!1!==J.settings.icon_margin?J.settings.icon_margin:E.padding_right),G.css("paddingRight",2*(!1!==J.settings.icon_margin?J.settings.icon_margin:E.padding_right)+p)):(Z.css("left",!1!==J.settings.icon_margin?J.settings.icon_margin:E.padding_left),G.css("paddingLeft",2*(!1!==J.settings.icon_margin?J.settings.icon_margin:E.padding_left)+p)):Z.css("left",h+(!1!==J.settings.icon_margin?J.settings.icon_margin:E.padding_left)),Z.removeClass("Zebra_DatePicker_Icon_Disabled"),"disabled"===G.attr("disabled"))&&Z.addClass("Zebra_DatePicker_Icon_Disabled")),gt=!1!==J.settings.show_select_today&&-1'+J.settings.navigation[1]+(bt?"︎":"")+'
',y=xt(l),J.datepicker=y,F=xt("table.dp_header",y),v=xt("table.dp_daypicker",y),x=xt("table.dp_monthpicker",y),T=xt("table.dp_yearpicker",y),N=xt("table.dp_timepicker",y),at=xt("table.dp_footer",y),z=xt("td.dp_today",at),m=xt("td.dp_clear",at),I=xt("td.dp_view_toggler",at),f=xt("td.dp_confirm",at),J.settings.always_visible instanceof jQuery?G.attr("disabled")||(J.settings.always_visible.append(y),J.show()):J.settings.container.append(y),y.on("mouseover","td:not(.dp_disabled)",function(){xt(this).addClass("dp_hover")}).on("mouseout","td:not(.dp_disabled)",function(){xt(this).removeClass("dp_hover")}),vt(y),xt(J.settings.rtl?".dp_next":".dp_previous",F).on("click",function(){"months"===R?O--:"years"===R?O-=12:--j<0&&(j=11,O--),V()}),J.settings.fast_navigation&&xt(".dp_caption",F).on("click",function(){R="days"===R?-1",J.settings.show_week_number&&(e+=''+J.settings.show_week_number+""),t=0;t<7;t++)s=(J.settings.first_day_of_week+(J.settings.rtl?6-t:t))%7,e+=''+(Array.isArray(J.settings.days_abbr)&&undefined!==J.settings.days_abbr[s]?J.settings.days_abbr[s]:J.settings.days[s].substr(0,2))+"";for(e+="",t=0;t<42;t++)c=J.settings.rtl?6-t%7*2:0,0"),t%7==0&&J.settings.show_week_number&&(e+=''+At(new Date(O,j,t-h+1))+""),s=t-h+1+c,J.settings.select_other_months&&(t'+(J.settings.select_other_months||J.settings.show_other_months?$(c+_-h+t+1,J.settings.zero_pad?2:0):" ")+"":l'+(J.settings.select_other_months||J.settings.show_other_months?$(s-l,J.settings.zero_pad?2:0):" ")+"":(c="",o=u(O,j,s),d&&(c=" dp_weekend"),j===et&&O===st&&tt===s&&(c+=" dp_current"),""!==o&&(c+=" "+o),j===nt&&O===k&&w===s&&(c+=" dp_selected"),U(O,j,s)&&(c+=" dp_disabled"),e+=""+((J.settings.zero_pad?$(s,2):s)||" ")+"");v.html(xt(e+="")),J.settings.always_visible&&(p=xt("td:not(.dp_disabled)",v)),v.show()},n=function(){Ct(J.settings.header_captions.months);for(var t,e,s="",n=0;n<12;n++)0"),t="dp_month_"+(e=J.settings.rtl?2+n-n%3*2:n),U(O,e)?t+=" dp_disabled":!1!==nt&&nt===e&&O===k?t+=" dp_selected":et===e&&st===O&&(t+=" dp_current"),s+=''+(Array.isArray(J.settings.months_abbr)&&undefined!==J.settings.months_abbr[e]?J.settings.months_abbr[e]:J.settings.months[e].substr(0,3))+"";x.html(xt(s+="")),J.settings.always_visible&&(d=xt("td:not(.dp_disabled)",x)),x.show()},i=function(){var t=L.hours&&L.minutes&&L.seconds&&L.ampm,e=''+(J.settings.rtl&&L.ampm?''+J.settings.navigation[2]+"":"")+(L.hours?''+J.settings.navigation[2]+"":"")+(L.minutes?''+J.settings.navigation[2]+"":"")+(L.seconds?''+J.settings.navigation[2]+"":"")+(!J.settings.rtl&&L.ampm?''+J.settings.navigation[2]+"":"")+"";e+='',J.settings.rtl&&L.ampm&&(e+='
'+("A"===L.ampm_case?Y.toUpperCase():Y)+"
"),L.hours&&(e+='
'+("h"===L.hour_format||"H"===L.hour_format?$(S,2):S)+"
"),L.minutes&&(e+='
'+$(ct,2)+"
"),L.seconds&&(e+='
'+$(lt,2)+"
"),!J.settings.rtl&&L.ampm&&(e+=''+("A"===L.ampm_case?Y.toUpperCase():Y)+""),e=e+''+(J.settings.rtl&&L.ampm?''+J.settings.navigation[3]+"":"")+(L.hours?''+J.settings.navigation[3]+"":"")+(L.minutes?''+J.settings.navigation[3]+"":"")+(L.seconds?''+J.settings.navigation[3]+"":"")+(!J.settings.rtl&&L.ampm?''+J.settings.navigation[3]+"":"")+"",N.html(xt(e)),N.show()},a=function(){Ct(J.settings.header_captions.years);for(var t,e,s="",n=0;n<12;n++)0"),e=J.settings.rtl?2+n-n%3*2:n,t="",U(O-7+e)?t+=" dp_disabled":k&&k===O-7+e?t+=" dp_selected":st===O-7+e&&(t+=" dp_current"),s+=""+(O-7+e)+"";T.html(xt(s+="")),J.settings.always_visible&&(c=xt("td:not(.dp_disabled)",T)),T.show()},u=function(s,n,i){var a,t,r;for(t in void 0!==n&&(n+=1),b)if(a=b[t],r=!1,Array.isArray(pt[a])&&xt.each(pt[a],function(){var t,e;return!r&&(-1q(o(dt,$(ot,2),$(rt,2)))))return!0;if(6===e&&(void 0!==H&&tq(o(dt,$(ot,2)))))return!0;if(4===e&&(void 0!==H&&t=i.length?0:n+1:n-1<0?i.length-1:n-1;"hour"===t[1]?S=i[e]:"minute"===t[1]?ct=i[e]:"second"===t[1]?lt=i[e]:Y=i[e],w=(w=!w&&J.settings.start_date&&(n=yt(J.settings.start_date))?n.getDate():w)||C,s.text($(i[e],2).toUpperCase()),Pt(O,j,w)},Pt=function(t,e,s,n,i){var a=new Date(t,e,s,L&&L.hours?S+(L.ampm?"pm"===Y&&12!==S?12:"am"===Y&&12===S?-12:0:0):12,L&&L.minutes?ct:0,L&&L.seconds?lt:0),r="days"===n?p:"months"===n?d:c,o=kt(a);G.val(o),(J.settings.always_visible||L)&&(nt=a.getMonth(),j=a.getMonth(),k=a.getFullYear(),O=a.getFullYear(),w=a.getDate(),i)&&r&&(r.removeClass("dp_selected"),i.addClass("dp_selected"),"days"===n)&&i.hasClass("dp_not_in_month")&&!i.hasClass("dp_disabled")&&J.show(),L?(R="time",V()):(G.focus(),J.hide()),Ft(a),!L&&J.settings.onSelect&&"function"==typeof J.settings.onSelect&&J.settings.onSelect.call(G,o,t+"-"+$(e+1,2)+"-"+$(s,2),a)},o=function(){for(var t="",e=0;e 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Best jQuery Date Time Picker Plugin - Zebra Datepicker - Super Lightweight & Highly Configurable 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | 35 |
36 |
37 |

The Ultimate jQuery Date Time Picker:
Zebra Datepickersuper-lightweight and highly-configurable

38 |
39 |

40 | Download 41 | View on GitHub 42 |

43 |
44 |
45 | 46 |
47 | 48 |
49 | 50 |
51 | 52 |
See the examples with the date pickers having the default or the metallic theme.
53 | 54 |
55 |
56 |

57 | Zebra Datepicker is a small, compact and highly configurable date picker / time picker 58 | jQuery plugin, meant to enrich forms by adding the date picker functionality to them. 59 | Zebra Datepicker is a user-friendly and highly configurable date and time picker jQuery plugin. 60 | Its lightweight design makes it easy to implement on any website, and it's compatible with 61 | all major browsers. With a range of customization options, you can easily tailor the plugin 62 | to suit your needs and enhance the functionality of your forms. Whether you're looking for 63 | a simple date time picker or a more advanced one, Zebra Datepicker has you covered. 64 |

65 |

66 | This jQuery plugin will automatically add a calendar icon to the indicated input fields 67 | which, when clicked, will open the attached date picker. 68 | This jQuery date time picker plugin will automatically add a calendar icon to the indicated 69 | input fields which, when clicked, will open the attached date time picker. 70 |

71 |

72 | Users can easily jump between months and years due to the date pickers intuitive interface. 73 | The selected date will be entered in the input field using the date format of choice, 74 | configurable in the date picker's options. 75 |

76 |
77 |
78 |
79 |
80 |
81 | 82 |
83 | 84 | 107 | 108 |
109 | 110 | 111 | 112 |

113 | 114 | Note that the Bootstrap theme does not actually require Twitter Bootstrap 115 | CSS framework to be present!
Its name comes from the fact that it borrows the color scheme from 116 | Twitter Bootstrap's default theme.
117 |

118 | 119 |

1. Default initialization

120 | 121 |

122 | All dates are selectable, no restrictions.
123 | There are a lot of things that can be configured! 124 |

125 | 126 |
127 |                     $('#datepicker').Zebra_DatePicker();
128 |                     
129 | 130 |
131 |
132 |
133 | 134 |
135 |
136 |
137 | 138 | 139 |
140 | ▲ To the top 141 |
142 | 143 | 144 | 145 |

2. Allow future dates only, starting one day in the future

146 | 147 |

148 | All past dates, including today, are disabled.
149 | Read more about using the direction property. 150 |

151 | 152 |
153 |                     $('#datepicker').Zebra_DatePicker({
154 |                         direction: 1
155 |                     });
156 |                     
157 | 158 |
159 |
160 |
161 | 162 |
163 |
164 |
165 | 166 | 167 |
168 | ▲ To the top 169 |
170 | 171 | 172 | 173 |

3. Allow dates from a dynamic interval

174 | 175 |

176 | The selectable dates are in the interval starting tomorrow and ending 10 days after that.
177 | Read more about using the direction property. 178 |

179 | 180 |
181 |                     $('#datepicker').Zebra_DatePicker({
182 |                         direction: [1, 10]
183 |                     });
184 |                     
185 | 186 |
187 |
188 |
189 | 190 |
191 |
192 |
193 | 194 | 195 |
196 | ▲ To the top 197 |
198 | 199 | 200 | 201 |

4. Allow dates from an interval between 2 dates

202 | 203 |

204 | Dates in the direction property have to be written in the date picker's date format.
205 | Read more about using the direction property. 206 |

207 | 208 |
209 |                     $('#datepicker').Zebra_DatePicker({
210 |                         direction: ['2012-08-01', '2012-08-12']
211 |                     });
212 |                     
213 | 214 |
215 |
216 |
217 | 218 |
219 |
220 |
221 | 222 | 223 |
224 | ▲ To the top 225 |
226 | 227 | 228 | 229 |

5. Allow only dates that come after a certain date

230 | 231 |

232 | Dates in the direction property have to be written in the date picker's date format.
233 | Read more about using the direction property. 234 |

235 | 236 |
237 |                     $('#datepicker').Zebra_DatePicker({
238 |                         direction: ['2012-08-01', false]
239 |                     });
240 |                     
241 | 242 |
243 |
244 |
245 | 246 |
247 |
248 |
249 | 250 | 251 |
252 | ▲ To the top 253 |
254 | 255 | 256 | 257 |

6. Disable dates

258 | 259 |

260 | Allow future dates only including the current day.
261 | All past dates are disabled.
262 | Saturday and Sundays are disabled.
263 | Read more about using the direction property and about disabling dates. 264 |

265 | 266 |
267 |                     $('#datepicker').Zebra_DatePicker({
268 |                         direction: true,
269 |                         disabled_dates: ['* * * 0,6']   // all days, all months, all years as long
270 |                                                         // as the weekday is 0 or 6 (Sunday or Saturday)
271 |                     });
272 |                     
273 | 274 |
275 |
276 |
277 | 278 |
279 |
280 |
281 | 282 | 283 |
284 | ▲ To the top 285 |
286 | 287 | 288 | 289 |

7. Date ranges (sort of)

290 | 291 |

The second date picker's starting date is the value of the first date picker + 1

292 | 293 |
294 |                     $('#datepicker-range-start').Zebra_DatePicker({
295 |                         direction: true,
296 |                         pair: $('#datepicker-range-end')
297 |                     });
298 | 
299 |                     $('#datepicker-range-end').Zebra_DatePicker({
300 |                         direction: 1
301 |                     });
302 |                     
303 | 304 |
305 |
306 |
307 | 308 |
309 |
310 | 311 |
312 |
313 |
314 | 315 | 316 |
317 | ▲ To the top 318 |
319 | 320 | 321 | 322 |

8. Date formats

323 | 324 |

325 | Accepts the following characters for date formatting: d, D, j, 326 | l, N, w, S, F, m, 327 | M, n, Y, y, h, H, 328 | g, G, i, s, a, A, 329 | borrowing the syntax from PHP's date 330 | function.
331 | 332 | If format property contains time-related characters (g, G, 333 | h, H, i, s, a, A), 334 | the time picker will be automatically enabled.
335 | 336 | Note that when setting a date format without days (d, j), the users will 337 | be able to select only years and months, and when setting a format without months and days 338 | (F, m, M, n, t, d, 339 | j), the users will be able to select only years. Similarly, setting a format that 340 | contains only time-related characters, will result in users being able to only select time. 341 |

342 | 343 |
344 |                     $('#datepicker').Zebra_DatePicker({
345 |                         format: 'M d, Y'
346 |                     });
347 |                     
348 | 349 |
350 |
351 |
352 | 353 |
354 |
355 |
356 | 357 | 358 |
359 | ▲ To the top 360 |
361 | 362 | 363 | 364 |

9. Enabling the time picker

365 | 366 |

367 | If format property contains time-related characters (g, G, 368 | h, H, i, s, a, A), 369 | the time picker will be automatically enabled. 370 |

371 | 372 |
373 |                     $('#datepicker').Zebra_DatePicker({
374 |                         format: 'Y-m-d H:i'
375 |                     });
376 |                     
377 | 378 |
379 |
380 |
381 | 382 |
383 |
384 |
385 | 386 | 387 |
388 | ▲ To the top 389 |
390 | 391 | 392 | 393 |

10. Partial date formats

394 | 395 |

396 | The date picker will not show views that are not present in format.
397 | 398 | In the example below, the date picker will never get to the day view as there is no 399 | day-related character in the date's format. 400 |

401 | 402 |
403 |                     $('#datepicker').Zebra_DatePicker({
404 |                         format: 'm Y',
405 |                     });
406 |                     
407 | 408 |
409 |
410 |
411 | 412 |
413 |
414 |
415 | 416 | 417 |
418 | ▲ To the top 419 |
420 | 421 | 422 | 423 |

11. Showing week numbers

424 | 425 |

426 | Show the ISO 8601 week number. 427 |

428 | 429 |
430 |                     $('#datepicker').Zebra_DatePicker({
431 |                         show_week_number: 'Wk'
432 |                     });
433 |                     
434 | 435 |
436 |
437 |
438 | 439 |
440 |
441 |
442 | 443 | 444 |
445 | ▲ To the top 446 |
447 | 448 | 449 | 450 |

12. Changing the starting view

451 | 452 |

453 | Start with the years view, recommended for when users need to select their birth 454 | date.
455 | 456 | You can always switch between views by clicking on caption in the date picker's header, between 457 | the previous and next buttons!
458 | 459 | Note that the date picker is always cycling days -> months -> years when clicking 460 | on the date picker's header, and years -> months -> days when selecting dates (skipping 461 | the views that are missing because of the date's format)
462 | 463 | Also note that the value of the view property may be overridden if the date's format requires so! (i.e. days for the view property makes no sense if the date format doesn't allow the selection of days) 464 | 465 |

466 | 467 |
468 |                     $('#datepicker').Zebra_DatePicker({
469 |                         view: 'years'
470 |                     });
471 |                     
472 | 473 |
474 |
475 |
476 | 477 |
478 |
479 |
480 | 481 | 482 |
483 | ▲ To the top 484 |
485 | 486 | 487 | 488 |

13. Custom classes

489 | 490 |

491 | Disable weekends and apply a custom class to Saturdays and Sundays. 492 |

493 | 494 |
495 |                     $('#datepicker').Zebra_DatePicker({
496 |                         disabled_dates: ['* * * 0,6'],
497 |                         custom_classes: {
498 |                             'myclass':  ['* * * 0,6']
499 |                         }
500 |                     });
501 |                     
502 | 503 |
504 |
505 |
506 | 507 |
508 |
509 |
510 | 511 | 512 |
513 | ▲ To the top 514 |
515 | 516 | 517 | 518 |

14. Handling the "onChange" event

519 | 520 |

521 | If a callback function is attached to the onChange event, it will be called whenever 522 | the user changes the view (days/months/years), as well as when the user navigates by clicking on 523 | the next/previous icons in any of the views. 524 |

525 | 526 |

The callback function takes two arguments:

527 | 528 |
    529 |
  • 530 | the view (days, months or years) 531 |
  • 532 |
  • 533 | the active elements (not disabled) in that view, as jQuery elements, allowing for 534 | easy customization and interaction with particular cells in the date picker's view 535 |
  • 536 |
537 | 538 |
539 |                     $('#datepicker').Zebra_DatePicker({
540 | 
541 |                         // execute a function whenever the user changes the view (days/months/years),
542 |                         // as well as when the user navigates by clicking on the "next"/"previous"
543 |                         // icons in any of the views
544 |                         onChange: function(view, elements) {
545 | 
546 |                             // on the "days" view...
547 |                             if (view == 'days') {
548 | 
549 |                                 // iterate through the active elements in the view
550 |                                 elements.each(function() {
551 | 
552 |                                     // to simplify searching for particular dates, each element gets a
553 |                                     // "date" data attribute which is the form of:
554 |                                     // - YYYY-MM-DD for elements in the "days" view
555 |                                     // - YYYY-MM for elements in the "months" view
556 |                                     // - YYYY for elements in the "years" view
557 | 
558 |                                     // so, because we're on a "days" view,
559 |                                     // let's find the 24th day using a regular expression
560 |                                     // (notice that this will apply to every 24th day
561 |                                     // of every month of every year)
562 |                                     if ($(this).data('date').match(/\-24$/))
563 | 
564 |                                         // and highlight it!
565 |                                         $(this).css({
566 |                                             background: '#C40000',
567 |                                             color:      '#FFF'
568 |                                         });
569 | 
570 |                                 });
571 | 
572 |                             }
573 | 
574 |                         }
575 |                     });
576 |                     
577 | 578 |
579 |
580 |
581 | 582 |
583 |
584 |
585 | 586 | 587 |
588 | ▲ To the top 589 |
590 | 591 | 592 | 593 |

15. Always-visible date pickers

594 | 595 |

596 | Set the always_visible property's value to a jQuery element which will act as a 597 | container for the date picker.
Notice that in this case the element the date picker is attached 598 | to has no icon. 599 |

600 | 601 |
602 |                     $('#datepicker').Zebra_DatePicker({
603 |                         always_visible: $('#container')
604 |                     });
605 |                     
606 | 607 |
608 | 609 |
610 |
611 |
612 | 613 |
614 |
615 |
616 | 617 | 618 |
619 | ▲ To the top 620 |
621 | 622 | 623 | 624 |

16. RTL support

625 | 626 |

627 | Set the rtl property to true to have the current language drawn from 628 | right to left. 629 |

630 | 631 |
632 |                     $('#datepicker').Zebra_DatePicker({
633 |                         rtl: true
634 |                     });
635 |                     
636 | 637 |
638 |
639 |
640 | 641 |
642 |
643 |
644 | 645 | 646 |
647 | ▲ To the top 648 |
649 | 650 | 651 | 652 |

17. Data attributes

653 | 654 |

655 | All the properties of the date picker can also be set via data-attributes.
656 | 657 | All you have to do is take any property described in the configuration section and 658 | prefix it with data-zdp_.
659 | 660 | Remember that if the value of the property is an array, you will have to use double 661 | quotes inside the square brackets and single quotes around the attribute, like in 662 | the example below: 663 |

664 | 665 |
666 |                     <input type="text" id="datepicker" data-zdp_direction="1" data-zdp_disabled_dates='["* * * 0,6"]'>
667 |                     
668 |
669 |                     $('#datepicker').Zebra_DatePicker();
670 |                     
671 | 672 |
673 |
674 |
675 | 676 |
677 |
678 |
679 | 680 |
681 | ▲ To the top 682 |
683 | 684 |

copyright © 2011 - stefan gabos

685 | 686 |
687 | 688 |
689 | 690 |
691 | 692 |
693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | -------------------------------------------------------------------------------- /examples/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefangabos/Zebra_Datepicker/881d1a6023d4d7cd265d9baa5e6420934c721863/examples/close.png -------------------------------------------------------------------------------- /examples/examples.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Tahoma, Helvetica, Arial, sans-serif; 3 | } 4 | 5 | h1 small { 6 | display: block; 7 | font-size: 50%; 8 | color: #666; 9 | margin-top: 0.2em; 10 | } 11 | 12 | .info { 13 | padding: 1em; 14 | background: #fafafa; 15 | } 16 | 17 | .syntaxhighlighter { 18 | padding: .5em 0; 19 | } 20 | 21 | #container { 22 | z-index: 100; 23 | } 24 | 25 | .Zebra_DatePicker .dp_daypicker .myclass { 26 | background: #E8E8E8 url('close.png') no-repeat center center; 27 | text-indent: -9999px; 28 | } 29 | 30 | .bootstrap .Zebra_DatePicker .dp_daypicker td.myclass_disabled { 31 | background: #FFF url('close.png') no-repeat center center; 32 | text-indent: -9999px; 33 | } 34 | 35 | .top { 36 | display: block; 37 | border-bottom: 1px solid #eee; 38 | margin-bottom: 33px; 39 | } 40 | 41 | .top a { 42 | background: #FFF; 43 | position: relative; 44 | top: 8px; 45 | padding-right: 10px; 46 | } 47 | 48 | blockquote.bg-warning.Zebra_Pin { 49 | border-bottom: 1px solid #ccc; 50 | box-shadow: 0 12px 6px -6px rgba(0, 0, 0, .1); 51 | transition: box-shadow .25s linear; 52 | } 53 | 54 | .screenshot { 55 | background: url('themes.png'); 56 | width: 270px; 57 | height: 285px; 58 | margin: 0 auto; 59 | } 60 | 61 | .screenshot-default { 62 | background-position: left -15px; 63 | } 64 | 65 | .screenshot-metallic { 66 | background-position: -270px -15px; 67 | } 68 | 69 | .screenshot-bootstrap { 70 | background-position: -542px -15px; 71 | } -------------------------------------------------------------------------------- /examples/examples.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | $('#datepicker').Zebra_DatePicker(); 4 | 5 | $('#datepicker-future-tomorrow').Zebra_DatePicker({ 6 | direction: 1 7 | }); 8 | 9 | $('#datepicker-dynamic-interval').Zebra_DatePicker({ 10 | direction: [1, 10] 11 | }); 12 | 13 | $('#datepicker-dates-interval').Zebra_DatePicker({ 14 | direction: ['2012-08-01', '2012-08-12'] 15 | }); 16 | 17 | $('#datepicker-after-date').Zebra_DatePicker({ 18 | direction: ['2012-08-01', false] 19 | }); 20 | 21 | $('#datepicker-disabled-dates').Zebra_DatePicker({ 22 | direction: true, 23 | disabled_dates: ['* * * 0,6'] 24 | }); 25 | 26 | $('#datepicker-range-start').Zebra_DatePicker({ 27 | direction: true, 28 | pair: $('#datepicker-range-end') 29 | }); 30 | 31 | $('#datepicker-range-end').Zebra_DatePicker({ 32 | direction: 1 33 | }); 34 | 35 | $('#datepicker-formats').Zebra_DatePicker({ 36 | format: 'M d, Y' 37 | }); 38 | 39 | $('#datepicker-time').Zebra_DatePicker({ 40 | format: 'Y-m-d H:i' 41 | }); 42 | 43 | $('#datepicker-week-number').Zebra_DatePicker({ 44 | show_week_number: 'Wk' 45 | }); 46 | 47 | $('#datepicker-starting-view').Zebra_DatePicker({ 48 | view: 'years' 49 | }); 50 | 51 | $('#datepicker-partial-date-formats').Zebra_DatePicker({ 52 | format: 'm Y' 53 | }); 54 | 55 | $('#datepicker-custom-classes').Zebra_DatePicker({ 56 | disabled_dates: ['* * * 0,6'], 57 | custom_classes: { 58 | 'myclass': ['* * * 0,6'] 59 | } 60 | }); 61 | 62 | $('#datepicker-on-change').Zebra_DatePicker({ 63 | onChange: function(view, elements) { 64 | if (view === 'days') { 65 | elements.each(function() { 66 | if ($(this).data('date').match(/\-24$/)) 67 | $(this).css({ 68 | background: '#C40000', 69 | color: '#FFF' 70 | }); 71 | }); 72 | } 73 | } 74 | }); 75 | 76 | $('#datepicker-always-visible').Zebra_DatePicker({ 77 | always_visible: $('#container') 78 | }); 79 | 80 | $('#datepicker-rtl-support').Zebra_DatePicker({ 81 | rtl: true 82 | }); 83 | 84 | $('#datepicker-data-attributes').Zebra_DatePicker(); 85 | 86 | setTimeout(function() { 87 | $.Zebra_Pin($('blockquote.bg-warning')); 88 | }, 500); 89 | 90 | }); -------------------------------------------------------------------------------- /examples/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefangabos/Zebra_Datepicker/881d1a6023d4d7cd265d9baa5e6420934c721863/examples/favicon.ico -------------------------------------------------------------------------------- /examples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Best jQuery Date Time Picker Plugin - Zebra Datepicker - Super Lightweight & Highly Configurable 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | 35 |
36 |
37 |

The Ultimate jQuery Date Time Picker:
Zebra Datepickersuper-lightweight and highly-configurable

38 |
39 |

40 | Download 41 | View on GitHub 42 |

43 |
44 |
45 | 46 |
47 | 48 |
49 | 50 |
51 | 52 |
See the examples with the date pickers having the metallic or the bootstrap theme.
53 | 54 |
55 |
56 |

57 | Zebra Datepicker is a small, compact and highly configurable date picker / time picker 58 | jQuery plugin, meant to enrich forms by adding the date picker functionality to them. 59 | Zebra Datepicker is a user-friendly and highly configurable date and time picker jQuery plugin. 60 | Its lightweight design makes it easy to implement on any website, and it's compatible with 61 | all major browsers. With a range of customization options, you can easily tailor the plugin 62 | to suit your needs and enhance the functionality of your forms. Whether you're looking for 63 | a simple date time picker or a more advanced one, Zebra Datepicker has you covered. 64 |

65 |

66 | This jQuery plugin will automatically add a calendar icon to the indicated input fields 67 | which, when clicked, will open the attached date picker. 68 | This jQuery date time picker plugin will automatically add a calendar icon to the indicated 69 | input fields which, when clicked, will open the attached date time picker. 70 |

71 |

72 | Users can easily jump between months and years due to the date pickers intuitive interface. 73 | The selected date will be entered in the input field using the date format of choice, 74 | configurable in the date picker's options. 75 |

76 |
77 |
78 |
79 |
80 |
81 | 82 |
83 | 84 | 107 | 108 | 109 |
110 | 111 | 112 | 113 |

1. Default initialization

114 | 115 |

116 | All dates are selectable, no restrictions.
117 | There are a lot of things that can be configured! 118 |

119 | 120 |
121 |                     $('#datepicker').Zebra_DatePicker();
122 |                     
123 | 124 |
125 |
126 |
127 | 128 |
129 |
130 |
131 | 132 | 133 |
134 | ▲ To the top 135 |
136 | 137 | 138 | 139 |

2. Allow future dates only, starting one day in the future

140 | 141 |

142 | All past dates, including today, are disabled.
143 | Read more about using the direction property. 144 |

145 | 146 |
147 |                     $('#datepicker').Zebra_DatePicker({
148 |                         direction: 1
149 |                     });
150 |                     
151 | 152 |
153 |
154 |
155 | 156 |
157 |
158 |
159 | 160 | 161 |
162 | ▲ To the top 163 |
164 | 165 | 166 | 167 |

3. Allow dates from a dynamic interval

168 | 169 |

170 | The selectable dates are in the interval starting tomorrow and ending 10 days after that.
171 | Read more about using the direction property. 172 |

173 | 174 |
175 |                     $('#datepicker').Zebra_DatePicker({
176 |                         direction: [1, 10]
177 |                     });
178 |                     
179 | 180 |
181 |
182 |
183 | 184 |
185 |
186 |
187 | 188 | 189 |
190 | ▲ To the top 191 |
192 | 193 | 194 | 195 |

4. Allow dates from an interval between 2 dates

196 | 197 |

198 | Dates in the direction property have to be written in the date picker's date format.
199 | Read more about using the direction property. 200 |

201 | 202 |
203 |                     $('#datepicker').Zebra_DatePicker({
204 |                         direction: ['2012-08-01', '2012-08-12']
205 |                     });
206 |                     
207 | 208 |
209 |
210 |
211 | 212 |
213 |
214 |
215 | 216 | 217 |
218 | ▲ To the top 219 |
220 | 221 | 222 | 223 |

5. Allow only dates that come after a certain date

224 | 225 |

226 | Dates in the direction property have to be written in the date picker's date format.
227 | Read more about using the direction property. 228 |

229 | 230 |
231 |                     $('#datepicker').Zebra_DatePicker({
232 |                         direction: ['2012-08-01', false]
233 |                     });
234 |                     
235 | 236 |
237 |
238 |
239 | 240 |
241 |
242 |
243 | 244 | 245 |
246 | ▲ To the top 247 |
248 | 249 | 250 | 251 |

6. Disable dates

252 | 253 |

254 | Allow future dates only including the current day.
255 | All past dates are disabled.
256 | Saturday and Sundays are disabled.
257 | Read more about using the direction property and about disabling dates. 258 |

259 | 260 |
261 |                     $('#datepicker').Zebra_DatePicker({
262 |                         direction: true,
263 |                         disabled_dates: ['* * * 0,6']   // all days, all months, all years as long
264 |                                                         // as the weekday is 0 or 6 (Sunday or Saturday)
265 |                     });
266 |                     
267 | 268 |
269 |
270 |
271 | 272 |
273 |
274 |
275 | 276 | 277 |
278 | ▲ To the top 279 |
280 | 281 | 282 | 283 |

7. Date ranges (sort of)

284 | 285 |

The second date picker's starting date is the value of the first date picker + 1

286 | 287 |
288 |                     $('#datepicker-range-start').Zebra_DatePicker({
289 |                         direction: true,
290 |                         pair: $('#datepicker-range-end')
291 |                     });
292 | 
293 |                     $('#datepicker-range-end').Zebra_DatePicker({
294 |                         direction: 1
295 |                     });
296 |                     
297 | 298 |
299 |
300 |
301 | 302 |
303 |
304 | 305 |
306 |
307 |
308 | 309 | 310 |
311 | ▲ To the top 312 |
313 | 314 | 315 | 316 |

8. Date formats

317 | 318 |

319 | Accepts the following characters for date formatting: d, D, j, 320 | l, N, w, S, F, m, 321 | M, n, Y, y, h, H, 322 | g, G, i, s, a, A, 323 | borrowing the syntax from PHP's date 324 | function.
325 | 326 | If format property contains time-related characters (g, G, 327 | h, H, i, s, a, A), 328 | the time picker will be automatically enabled.
329 | 330 | Note that when setting a date format without days (d, j), the users will 331 | be able to select only years and months, and when setting a format without months and days 332 | (F, m, M, n, t, d, 333 | j), the users will be able to select only years. Similarly, setting a format that 334 | contains only time-related characters, will result in users being able to only select time. 335 |

336 | 337 |
338 |                     $('#datepicker').Zebra_DatePicker({
339 |                         format: 'M d, Y'
340 |                     });
341 |                     
342 | 343 |
344 |
345 |
346 | 347 |
348 |
349 |
350 | 351 | 352 |
353 | ▲ To the top 354 |
355 | 356 | 357 | 358 |

9. Enabling the time picker

359 | 360 |

361 | If format property contains time-related characters (g, G, 362 | h, H, i, s, a, A), 363 | the time picker will be automatically enabled. 364 |

365 | 366 |
367 |                     $('#datepicker').Zebra_DatePicker({
368 |                         format: 'Y-m-d H:i'
369 |                     });
370 |                     
371 | 372 |
373 |
374 |
375 | 376 |
377 |
378 |
379 | 380 | 381 |
382 | ▲ To the top 383 |
384 | 385 | 386 | 387 |

10. Partial date formats

388 | 389 |

390 | The date picker will not show views that are not present in format.
391 | 392 | In the example below, the date picker will never get to the day view as there is no 393 | day-related character in the date's format. 394 |

395 | 396 |
397 |                     $('#datepicker').Zebra_DatePicker({
398 |                         format: 'm Y',
399 |                     });
400 |                     
401 | 402 |
403 |
404 |
405 | 406 |
407 |
408 |
409 | 410 | 411 |
412 | ▲ To the top 413 |
414 | 415 | 416 | 417 |

11. Showing week numbers

418 | 419 |

420 | Show the ISO 8601 week number. 421 |

422 | 423 |
424 |                     $('#datepicker').Zebra_DatePicker({
425 |                         show_week_number: 'Wk'
426 |                     });
427 |                     
428 | 429 |
430 |
431 |
432 | 433 |
434 |
435 |
436 | 437 | 438 |
439 | ▲ To the top 440 |
441 | 442 | 443 | 444 |

12. Changing the starting view

445 | 446 |

447 | Start with the years view, recommended for when users need to select their birth 448 | date.
449 | 450 | You can always switch between views by clicking on caption in the date picker's header, between 451 | the previous and next buttons!
452 | 453 | Note that the date picker is always cycling days -> months -> years when clicking 454 | on the date picker's header, and years -> months -> days when selecting dates (skipping 455 | the views that are missing because of the date's format)
456 | 457 | Also note that the value of the view property may be overridden if the date's format requires so! (i.e. days for the view property makes no sense if the date format doesn't allow the selection of days) 458 | 459 |

460 | 461 |
462 |                     $('#datepicker').Zebra_DatePicker({
463 |                         view: 'years'
464 |                     });
465 |                     
466 | 467 |
468 |
469 |
470 | 471 |
472 |
473 |
474 | 475 | 476 |
477 | ▲ To the top 478 |
479 | 480 | 481 | 482 |

13. Custom classes

483 | 484 |

485 | Disable weekends and apply a custom class to Saturdays and Sundays. 486 |

487 | 488 |
489 |                     $('#datepicker').Zebra_DatePicker({
490 |                         disabled_dates: ['* * * 0,6'],
491 |                         custom_classes: {
492 |                             'myclass':  ['* * * 0,6']
493 |                         }
494 |                     });
495 |                     
496 | 497 |
498 |
499 |
500 | 501 |
502 |
503 |
504 | 505 | 506 |
507 | ▲ To the top 508 |
509 | 510 | 511 | 512 |

14. Handling the "onChange" event

513 | 514 |

515 | If a callback function is attached to the onChange event, it will be called whenever 516 | the user changes the view (days/months/years), as well as when the user navigates by clicking on 517 | the next/previous icons in any of the views. 518 |

519 | 520 |

The callback function takes two arguments:

521 | 522 |
    523 |
  • 524 | the view (days, months or years) 525 |
  • 526 |
  • 527 | the active elements (not disabled) in that view, as jQuery elements, allowing for 528 | easy customization and interaction with particular cells in the date picker's view 529 |
  • 530 |
531 | 532 |
533 |                     $('#datepicker').Zebra_DatePicker({
534 | 
535 |                         // execute a function whenever the user changes the view (days/months/years),
536 |                         // as well as when the user navigates by clicking on the "next"/"previous"
537 |                         // icons in any of the views
538 |                         onChange: function(view, elements) {
539 | 
540 |                             // on the "days" view...
541 |                             if (view == 'days') {
542 | 
543 |                                 // iterate through the active elements in the view
544 |                                 elements.each(function() {
545 | 
546 |                                     // to simplify searching for particular dates, each element gets a
547 |                                     // "date" data attribute which is the form of:
548 |                                     // - YYYY-MM-DD for elements in the "days" view
549 |                                     // - YYYY-MM for elements in the "months" view
550 |                                     // - YYYY for elements in the "years" view
551 | 
552 |                                     // so, because we're on a "days" view,
553 |                                     // let's find the 24th day using a regular expression
554 |                                     // (notice that this will apply to every 24th day
555 |                                     // of every month of every year)
556 |                                     if ($(this).data('date').match(/\-24$/))
557 | 
558 |                                         // and highlight it!
559 |                                         $(this).css({
560 |                                             background: '#C40000',
561 |                                             color:      '#FFF'
562 |                                         });
563 | 
564 |                                 });
565 | 
566 |                             }
567 | 
568 |                         }
569 |                     });
570 |                     
571 | 572 |
573 |
574 |
575 | 576 |
577 |
578 |
579 | 580 | 581 |
582 | ▲ To the top 583 |
584 | 585 | 586 | 587 |

15. Always-visible date pickers

588 | 589 |

590 | Set the always_visible property's value to a jQuery element which will act as a 591 | container for the date picker.
Notice that in this case the element the date picker is attached 592 | to has no icon. 593 |

594 | 595 |
596 |                     $('#datepicker').Zebra_DatePicker({
597 |                         always_visible: $('#container')
598 |                     });
599 |                     
600 | 601 |
602 | 603 |
604 |
605 |
606 | 607 |
608 |
609 |
610 | 611 | 612 |
613 | ▲ To the top 614 |
615 | 616 | 617 | 618 |

16. RTL support

619 | 620 |

621 | Set the rtl property to true to have the current language drawn from 622 | right to left. 623 |

624 | 625 |
626 |                     $('#datepicker').Zebra_DatePicker({
627 |                         rtl: true
628 |                     });
629 |                     
630 | 631 |
632 |
633 |
634 | 635 |
636 |
637 |
638 | 639 | 640 |
641 | ▲ To the top 642 |
643 | 644 | 645 | 646 |

17. Data attributes

647 | 648 |

649 | All the properties of the date picker can also be set via data-attributes.
650 | 651 | All you have to do is take any property described in the configuration section and 652 | prefix it with data-zdp_.
653 | 654 | Remember that if the value of the property is an array, you will have to use double 655 | quotes inside the square brackets and single quotes around the attribute, like in 656 | the example below: 657 |

658 | 659 |
660 |                     <input type="text" id="datepicker" data-zdp_direction="1" data-zdp_disabled_dates='["* * * 0,6"]'>
661 |                     
662 |
663 |                     $('#datepicker').Zebra_DatePicker();
664 |                     
665 | 666 |
667 |
668 |
669 | 670 |
671 |
672 |
673 | 674 |
675 | ▲ To the top 676 |
677 | 678 |

copyright © 2011 - stefan gabos

679 | 680 |
681 | 682 |
683 | 684 |
685 | 686 |
687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | -------------------------------------------------------------------------------- /examples/metallic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Best jQuery Date Time Picker Plugin - Zebra Datepicker - Super Lightweight & Highly Configurable 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | 35 |
36 |
37 |

The Ultimate jQuery Date Time Picker:
Zebra Datepickersuper-lightweight and highly-configurable

38 |
39 |

40 | Download 41 | View on GitHub 42 |

43 |
44 |
45 | 46 |
47 | 48 |
49 | 50 |
51 | 52 |
See the examples with the date pickers having the default or the bootstrap theme.
53 | 54 |
55 |
56 |

57 | Zebra Datepicker is a small, compact and highly configurable date picker / time picker 58 | jQuery plugin, meant to enrich forms by adding the date picker functionality to them. 59 | Zebra Datepicker is a user-friendly and highly configurable date and time picker jQuery plugin. 60 | Its lightweight design makes it easy to implement on any website, and it's compatible with 61 | all major browsers. With a range of customization options, you can easily tailor the plugin 62 | to suit your needs and enhance the functionality of your forms. Whether you're looking for 63 | a simple date time picker or a more advanced one, Zebra Datepicker has you covered. 64 |

65 |

66 | This jQuery plugin will automatically add a calendar icon to the indicated input fields 67 | which, when clicked, will open the attached date picker. 68 | This jQuery date time picker plugin will automatically add a calendar icon to the indicated 69 | input fields which, when clicked, will open the attached date time picker. 70 |

71 |

72 | Users can easily jump between months and years due to the date pickers intuitive interface. 73 | The selected date will be entered in the input field using the date format of choice, 74 | configurable in the date picker's options. 75 |

76 |
77 |
78 |
79 |
80 |
81 | 82 |
83 | 84 | 107 | 108 | 109 |
110 | 111 | 112 | 113 |

1. Default initialization

114 | 115 |

116 | All dates are selectable, no restrictions.
117 | There are a lot of things that can be configured! 118 |

119 | 120 |
121 |                     $('#datepicker').Zebra_DatePicker();
122 |                     
123 | 124 |
125 |
126 |
127 | 128 |
129 |
130 |
131 | 132 | 133 |
134 | ▲ To the top 135 |
136 | 137 | 138 | 139 |

2. Allow future dates only, starting one day in the future

140 | 141 |

142 | All past dates, including today, are disabled.
143 | Read more about using the direction property. 144 |

145 | 146 |
147 |                     $('#datepicker').Zebra_DatePicker({
148 |                         direction: 1
149 |                     });
150 |                     
151 | 152 |
153 |
154 |
155 | 156 |
157 |
158 |
159 | 160 | 161 |
162 | ▲ To the top 163 |
164 | 165 | 166 | 167 |

3. Allow dates from a dynamic interval

168 | 169 |

170 | The selectable dates are in the interval starting tomorrow and ending 10 days after that.
171 | Read more about using the direction property. 172 |

173 | 174 |
175 |                     $('#datepicker').Zebra_DatePicker({
176 |                         direction: [1, 10]
177 |                     });
178 |                     
179 | 180 |
181 |
182 |
183 | 184 |
185 |
186 |
187 | 188 | 189 |
190 | ▲ To the top 191 |
192 | 193 | 194 | 195 |

4. Allow dates from an interval between 2 dates

196 | 197 |

198 | Dates in the direction property have to be written in the date picker's date format.
199 | Read more about using the direction property. 200 |

201 | 202 |
203 |                     $('#datepicker').Zebra_DatePicker({
204 |                         direction: ['2012-08-01', '2012-08-12']
205 |                     });
206 |                     
207 | 208 |
209 |
210 |
211 | 212 |
213 |
214 |
215 | 216 | 217 |
218 | ▲ To the top 219 |
220 | 221 | 222 | 223 |

5. Allow only dates that come after a certain date

224 | 225 |

226 | Dates in the direction property have to be written in the date picker's date format.
227 | Read more about using the direction property. 228 |

229 | 230 |
231 |                     $('#datepicker').Zebra_DatePicker({
232 |                         direction: ['2012-08-01', false]
233 |                     });
234 |                     
235 | 236 |
237 |
238 |
239 | 240 |
241 |
242 |
243 | 244 | 245 |
246 | ▲ To the top 247 |
248 | 249 | 250 | 251 |

6. Disable dates

252 | 253 |

254 | Allow future dates only including the current day.
255 | All past dates are disabled.
256 | Saturday and Sundays are disabled.
257 | Read more about using the direction property and about disabling dates. 258 |

259 | 260 |
261 |                     $('#datepicker').Zebra_DatePicker({
262 |                         direction: true,
263 |                         disabled_dates: ['* * * 0,6']   // all days, all months, all years as long
264 |                                                         // as the weekday is 0 or 6 (Sunday or Saturday)
265 |                     });
266 |                     
267 | 268 |
269 |
270 |
271 | 272 |
273 |
274 |
275 | 276 | 277 |
278 | ▲ To the top 279 |
280 | 281 | 282 | 283 |

7. Date ranges (sort of)

284 | 285 |

The second date picker's starting date is the value of the first date picker + 1

286 | 287 |
288 |                     $('#datepicker-range-start').Zebra_DatePicker({
289 |                         direction: true,
290 |                         pair: $('#datepicker-range-end')
291 |                     });
292 | 
293 |                     $('#datepicker-range-end').Zebra_DatePicker({
294 |                         direction: 1
295 |                     });
296 |                     
297 | 298 |
299 |
300 |
301 | 302 |
303 |
304 | 305 |
306 |
307 |
308 | 309 | 310 |
311 | ▲ To the top 312 |
313 | 314 | 315 | 316 |

8. Date formats

317 | 318 |

319 | Accepts the following characters for date formatting: d, D, j, 320 | l, N, w, S, F, m, 321 | M, n, Y, y, h, H, 322 | g, G, i, s, a, A, 323 | borrowing the syntax from PHP's date 324 | function.
325 | 326 | If format property contains time-related characters (g, G, 327 | h, H, i, s, a, A), 328 | the time picker will be automatically enabled.
329 | 330 | Note that when setting a date format without days (d, j), the users will 331 | be able to select only years and months, and when setting a format without months and days 332 | (F, m, M, n, t, d, 333 | j), the users will be able to select only years. Similarly, setting a format that 334 | contains only time-related characters, will result in users being able to only select time. 335 |

336 | 337 |
338 |                     $('#datepicker').Zebra_DatePicker({
339 |                         format: 'M d, Y'
340 |                     });
341 |                     
342 | 343 |
344 |
345 |
346 | 347 |
348 |
349 |
350 | 351 | 352 |
353 | ▲ To the top 354 |
355 | 356 | 357 | 358 |

9. Enabling the time picker

359 | 360 |

361 | If format property contains time-related characters (g, G, 362 | h, H, i, s, a, A), 363 | the time picker will be automatically enabled. 364 |

365 | 366 |
367 |                     $('#datepicker').Zebra_DatePicker({
368 |                         format: 'Y-m-d H:i'
369 |                     });
370 |                     
371 | 372 |
373 |
374 |
375 | 376 |
377 |
378 |
379 | 380 | 381 |
382 | ▲ To the top 383 |
384 | 385 | 386 | 387 |

10. Partial date formats

388 | 389 |

390 | The date picker will not show views that are not present in format.
391 | 392 | In the example below, the date picker will never get to the day view as there is no 393 | day-related character in the date's format. 394 |

395 | 396 |
397 |                     $('#datepicker').Zebra_DatePicker({
398 |                         format: 'm Y',
399 |                     });
400 |                     
401 | 402 |
403 |
404 |
405 | 406 |
407 |
408 |
409 | 410 | 411 |
412 | ▲ To the top 413 |
414 | 415 | 416 | 417 |

11. Showing week numbers

418 | 419 |

420 | Show the ISO 8601 week number. 421 |

422 | 423 |
424 |                     $('#datepicker').Zebra_DatePicker({
425 |                         show_week_number: 'Wk'
426 |                     });
427 |                     
428 | 429 |
430 |
431 |
432 | 433 |
434 |
435 |
436 | 437 | 438 |
439 | ▲ To the top 440 |
441 | 442 | 443 | 444 |

12. Changing the starting view

445 | 446 |

447 | Start with the years view, recommended for when users need to select their birth 448 | date.
449 | 450 | You can always switch between views by clicking on caption in the date picker's header, between 451 | the previous and next buttons!
452 | 453 | Note that the date picker is always cycling days -> months -> years when clicking 454 | on the date picker's header, and years -> months -> days when selecting dates (skipping 455 | the views that are missing because of the date's format)
456 | 457 | Also note that the value of the view property may be overridden if the date's format requires so! (i.e. days for the view property makes no sense if the date format doesn't allow the selection of days) 458 | 459 |

460 | 461 |
462 |                     $('#datepicker').Zebra_DatePicker({
463 |                         view: 'years'
464 |                     });
465 |                     
466 | 467 |
468 |
469 |
470 | 471 |
472 |
473 |
474 | 475 | 476 |
477 | ▲ To the top 478 |
479 | 480 | 481 | 482 |

13. Custom classes

483 | 484 |

485 | Disable weekends and apply a custom class to Saturdays and Sundays. 486 |

487 | 488 |
489 |                     $('#datepicker').Zebra_DatePicker({
490 |                         disabled_dates: ['* * * 0,6'],
491 |                         custom_classes: {
492 |                             'myclass':  ['* * * 0,6']
493 |                         }
494 |                     });
495 |                     
496 | 497 |
498 |
499 |
500 | 501 |
502 |
503 |
504 | 505 | 506 |
507 | ▲ To the top 508 |
509 | 510 | 511 | 512 |

14. Handling the "onChange" event

513 | 514 |

515 | If a callback function is attached to the onChange event, it will be called whenever 516 | the user changes the view (days/months/years), as well as when the user navigates by clicking on 517 | the next/previous icons in any of the views. 518 |

519 | 520 |

The callback function takes two arguments:

521 | 522 |
    523 |
  • 524 | the view (days, months or years) 525 |
  • 526 |
  • 527 | the active elements (not disabled) in that view, as jQuery elements, allowing for 528 | easy customization and interaction with particular cells in the date picker's view 529 |
  • 530 |
531 | 532 |
533 |                     $('#datepicker').Zebra_DatePicker({
534 | 
535 |                         // execute a function whenever the user changes the view (days/months/years),
536 |                         // as well as when the user navigates by clicking on the "next"/"previous"
537 |                         // icons in any of the views
538 |                         onChange: function(view, elements) {
539 | 
540 |                             // on the "days" view...
541 |                             if (view == 'days') {
542 | 
543 |                                 // iterate through the active elements in the view
544 |                                 elements.each(function() {
545 | 
546 |                                     // to simplify searching for particular dates, each element gets a
547 |                                     // "date" data attribute which is the form of:
548 |                                     // - YYYY-MM-DD for elements in the "days" view
549 |                                     // - YYYY-MM for elements in the "months" view
550 |                                     // - YYYY for elements in the "years" view
551 | 
552 |                                     // so, because we're on a "days" view,
553 |                                     // let's find the 24th day using a regular expression
554 |                                     // (notice that this will apply to every 24th day
555 |                                     // of every month of every year)
556 |                                     if ($(this).data('date').match(/\-24$/))
557 | 
558 |                                         // and highlight it!
559 |                                         $(this).css({
560 |                                             background: '#C40000',
561 |                                             color:      '#FFF'
562 |                                         });
563 | 
564 |                                 });
565 | 
566 |                             }
567 | 
568 |                         }
569 |                     });
570 |                     
571 | 572 |
573 |
574 |
575 | 576 |
577 |
578 |
579 | 580 | 581 |
582 | ▲ To the top 583 |
584 | 585 | 586 | 587 |

15. Always-visible date pickers

588 | 589 |

590 | Set the always_visible property's value to a jQuery element which will act as a 591 | container for the date picker.
Notice that in this case the element the date picker is attached 592 | to has no icon. 593 |

594 | 595 |
596 |                     $('#datepicker').Zebra_DatePicker({
597 |                         always_visible: $('#container')
598 |                     });
599 |                     
600 | 601 |
602 | 603 |
604 |
605 |
606 | 607 |
608 |
609 |
610 | 611 | 612 |
613 | ▲ To the top 614 |
615 | 616 | 617 | 618 |

16. RTL support

619 | 620 |

621 | Set the rtl property to true to have the current language drawn from 622 | right to left. 623 |

624 | 625 |
626 |                     $('#datepicker').Zebra_DatePicker({
627 |                         rtl: true
628 |                     });
629 |                     
630 | 631 |
632 |
633 |
634 | 635 |
636 |
637 |
638 | 639 | 640 |
641 | ▲ To the top 642 |
643 | 644 | 645 | 646 |

17. Data attributes

647 | 648 |

649 | All the properties of the date picker can also be set via data-attributes.
650 | 651 | All you have to do is take any property described in the configuration section and 652 | prefix it with data-zdp_.
653 | 654 | Remember that if the value of the property is an array, you will have to use double 655 | quotes inside the square brackets and single quotes around the attribute, like in 656 | the example below: 657 |

658 | 659 |
660 |                     <input type="text" id="datepicker" data-zdp_direction="1" data-zdp_disabled_dates='["* * * 0,6"]'>
661 |                     
662 |
663 |                     $('#datepicker').Zebra_DatePicker();
664 |                     
665 | 666 |
667 |
668 |
669 | 670 |
671 |
672 |
673 | 674 |
675 | ▲ To the top 676 |
677 | 678 |

copyright © 2011 - stefan gabos

679 | 680 |
681 | 682 |
683 | 684 |
685 | 686 |
687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | --------------------------------------------------------------------------------