Skip to content

Commit

Permalink
Add datepicker to transactions form
Browse files Browse the repository at this point in the history
  • Loading branch information
ctessier committed Mar 8, 2016
1 parent 74fa6b5 commit d51f4fc
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
7 changes: 7 additions & 0 deletions public/css/jquery-ui.min.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions public/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
initAjaxForms();
initAjaxLightbox();
initTabs();
initDateFields();
$('form').attr('novalidate', 'novalidate');
});
}(window.jQuery, window, document));
Expand Down Expand Up @@ -221,6 +222,8 @@ function initAjaxLightbox() {
window.scrollTo(0, 0);
linkElement.removeClass('loading');
opened = true;

initDateFields();
});
}

Expand All @@ -235,3 +238,9 @@ function initAjaxLightbox() {
container.on('click', '*[data-lightbox-dismiss=true]', dismiss);

}

function initDateFields() {
$(".datepicker").datepicker({
dateFormat: 'yy-mm-dd'
});
}
13 changes: 13 additions & 0 deletions public/js/jquery-ui.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions resources/views/layouts/front.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<title>@yield('title') | Budgeck</title>
<link rel="stylesheet" href="/css/foundation.min.css" />
<link rel="stylesheet" href="/css/app.css" />
<link rel="stylesheet" href="/css/jquery-ui.min.css" />
<script type="text/javascript" src="/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
@yield('head')
</head>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/transactions/getEdit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<div class="columns large-6">
<div class="form-group">
{!! Form::label('transaction_date', 'Date de transaction') !!}
{!! Form::text('transaction_date', null, ['placeholder' => 'Date de transaction...']) !!}
{!! Form::text('transaction_date', null, ['placeholder' => 'Date de transaction...', 'class' => 'datepicker']) !!}
</div>
</div>
</div>
Expand All @@ -61,7 +61,7 @@
<div class="columns large-6">
<div class="form-group">
{!! Form::label('effective_date', 'Date effective') !!}
{!! Form::text('effective_date', null, ['placeholder' => 'Date effective...']) !!}
{!! Form::text('effective_date', null, ['placeholder' => 'Date effective...', 'class' => 'datepicker']) !!}
</div>
</div>
</div>
Expand Down

0 comments on commit d51f4fc

Please sign in to comment.