Skip to content

Commit

Permalink
Use JS datepicker instead of input type="date"
Browse files Browse the repository at this point in the history
1. It doesn't work in Safari
2. Looks really ugly/broken in Firefox.
3. Very hard to style input type="date" with any sense of sanity.

So ... just use a JS solution instead of "HTML 5", except on mobile
where the UI of the native datepicker is a lot better.

Fixes #91
  • Loading branch information
arp242 committed Jan 2, 2020
1 parent e35f9ae commit 2cc3929
Show file tree
Hide file tree
Showing 8 changed files with 3,027 additions and 25 deletions.
1,540 changes: 1,522 additions & 18 deletions pack/pack.go

Large diffs are not rendered by default.

224 changes: 224 additions & 0 deletions public/pikaday.css
@@ -0,0 +1,224 @@
@charset "UTF-8";

/*!
* Pikaday
* Copyright © 2014 David Bushell | BSD & MIT license | https://dbushell.com/
*/

.pika-single {
z-index: 9999;
display: block;
position: relative;
color: #333;
background: #fff;
border: 1px solid #ccc;
border-bottom-color: #bbb;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/*
clear child float (pika-lendar), using the famous micro clearfix hack
http://nicolasgallagher.com/micro-clearfix-hack/
*/
.pika-single:before,
.pika-single:after {
content: " ";
display: table;
}
.pika-single:after { clear: both }

.pika-single.is-hidden {
display: none;
}

.pika-single.is-bound {
position: absolute;
box-shadow: 0 5px 15px -5px rgba(0,0,0,.5);
}

.pika-lendar {
float: left;
width: 240px;
margin: 8px;
}

.pika-title {
position: relative;
text-align: center;
}

.pika-label {
display: inline-block;
position: relative;
z-index: 9999;
overflow: hidden;
margin: 0;
padding: 5px 3px;
font-size: 14px;
line-height: 20px;
font-weight: bold;
background-color: #fff;
}
.pika-title select {
cursor: pointer;
position: absolute;
z-index: 9998;
margin: 0;
left: 0;
top: 5px;
opacity: 0;
}

.pika-prev,
.pika-next {
display: block;
cursor: pointer;
position: relative;
outline: none;
border: 0;
padding: 0;
width: 20px;
height: 30px;
background-color: transparent;
background-position: center center;
background-repeat: no-repeat;
background-size: 75% 75%;
opacity: .5;
}

.pika-prev:hover,
.pika-next:hover {
opacity: 1;
}

.pika-prev,
.is-rtl .pika-next {
float: left;
}

.pika-next,
.is-rtl .pika-prev {
float: right;
}

.pika-prev.is-disabled,
.pika-next.is-disabled {
cursor: default;
opacity: .2;
}

.pika-select {
display: inline-block;
}

.pika-table {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
border: 0;
}

.pika-table th,
.pika-table td {
width: 14.285714285714286%;
padding: 0;
}

.pika-table th {
color: #999;
font-size: 12px;
line-height: 25px;
font-weight: bold;
text-align: center;
}

.pika-button {
cursor: pointer;
display: block;
box-sizing: border-box;
-moz-box-sizing: border-box;
outline: none;
border: 0;
margin: 0;
width: 100%;
padding: 5px;
color: #666;
font-size: 12px;
line-height: 15px;
text-align: right;
background: #f5f5f5;
}

.pika-week {
font-size: 11px;
color: #999;
}

.is-today .pika-button {
color: #33aaff;
font-weight: bold;
}

.is-selected .pika-button,
.has-event .pika-button {
color: #fff;
font-weight: bold;
background: #33aaff;
box-shadow: inset 0 1px 3px #178fe5;
border-radius: 3px;
}

.has-event .pika-button {
background: #005da9;
box-shadow: inset 0 1px 3px #0076c9;
}

.is-disabled .pika-button,
.is-inrange .pika-button {
background: #D5E9F7;
}

.is-startrange .pika-button {
color: #fff;
background: #6CB31D;
box-shadow: none;
border-radius: 3px;
}

.is-endrange .pika-button {
color: #fff;
background: #33aaff;
box-shadow: none;
border-radius: 3px;
}

.is-disabled .pika-button {
pointer-events: none;
cursor: default;
color: #999;
opacity: .3;
}

.is-outside-current-month .pika-button {
color: #999;
opacity: .3;
}

.is-selection-disabled {
pointer-events: none;
cursor: default;
}

.pika-button:hover,
.pika-row.pick-whole-week:hover .pika-button {
color: #fff;
background: #ff8000;
box-shadow: none;
border-radius: 3px;
}

/* styling for abbr */
.pika-table abbr {
border-bottom: none;
cursor: help;
}

0 comments on commit 2cc3929

Please sign in to comment.