Skip to content

Commit

Permalink
fix(components): added calendar icon to daterangepicker component
Browse files Browse the repository at this point in the history
feature/150167-datepicker
  • Loading branch information
liviaalmeida committed Nov 14, 2019
1 parent 43577dc commit 59c6ce0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/blipDaterangepicker/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import Component from 'nanocomponent'
import html from 'nanohtml'
// import raw from 'nanohtml/raw'
import raw from 'nanohtml/raw'

import { BlipDatepicker } from '../blipDatepicker'
import { DateHelper } from './../shared'
import { eventPathFindElementByTag } from './../../lib/utils'

import Calendar from '../../img/calendar-outline.svg'

const datepickerContainerClass = 'bp-daterange-datepicker'

const inputContainerClass = 'bp-daterange-inputs'
Expand All @@ -21,6 +24,8 @@ export class BlipDaterangepicker extends Component {

options = options || {}

this.hasTime = options.hasTime || false

this.months = options.months
this.weekdays = options.weekdays

Expand All @@ -43,6 +48,7 @@ export class BlipDaterangepicker extends Component {
const daterangepicker = html`
<div class="bp-daterange-picker">
<div class="${inputContainerClass}">
<div class="bp-daterange-icon">${raw(Calendar)}</div>
<input type="text" class="${startDateInputClass}" readonly>
<span>~</span>
<input type="text" class="${endDateInputClass}" readonly>
Expand Down Expand Up @@ -92,7 +98,7 @@ export class BlipDaterangepicker extends Component {
let staticPicker

return {
hasTime: true,
hasTime: this.hasTime,
i18n: {
months: this.months,
weekdays: this.weekdays,
Expand Down
3 changes: 3 additions & 0 deletions src/img/calendar-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/scss/components/_daterangepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,24 @@
@include bp-shadow(0, 0, 1px, 1px, $bp-color-bot);
}

.bp-daterange-icon {
padding: 0;
vertical-align: middle;
@include fixed-size(2.5*$m);
padding: 0.2*$m;
background-color: $bp-color-sky;
border-radius: 5px;
display: inline-block;

svg path {
fill: $bp-color-bot;
}
}

input {
width: 14*$m;
text-align: center;
vertical-align: middle;

&::-ms-clear {
display: none;
Expand Down

0 comments on commit 59c6ce0

Please sign in to comment.