WiceGrid provides four filters for selecting dates and time:
:jquery_datepicker
- Jquery datepicker (works for datetime, too)
:bootstrap_datepicker
- Bootstrap datepicker (works for datetime, too)
:rails_date_helper
- standard Rails date helper
:rails_datetime_helper
- standard Rails datetime helper
Default filters are defined in configuration constants
Wice::Defaults::DEFAULT_FILTER_FOR_DATE
and
Wice::Defaults::DEFAULT_FILTER_FOR_DATETIME.
By default
:jquery_datepicker
is used for both dates and time.
# encoding: utf-8 class DatesController < ApplicationController def index @tasks_grid = initialize_grid(Task, order: 'id' ) end end
<%= grid(@tasks_grid) do |g|
g.column name: 'ID', attribute: 'id', filter: false
g.column name: 'Title', attribute: 'title'
g.column name: 'Archived', attribute: 'archived' do |task|
task.archived? ? 'Yes' : 'No'
end
g.column name: 'Due Date', attribute: 'due_date' do |task|
task.due_date if task.due_date
end
g.column name: 'Added', attribute: 'created_at' do |task|
task.created_at.to_s(:db)
end
g.column name: 'Updated', attribute: 'updated_at', filter_type: :rails_datetime_helper do |task|
task.updated_at.to_s(:db)
end
end -%>
.well %h2= current_page_title %p WiceGrid provides four filters for selecting dates and time: %ul %li %code \:jquery_datepicker \- Jquery datepicker (works for datetime, too) %li %code \:bootstrap_datepicker \- Bootstrap datepicker (works for datetime, too) %li %code \:rails_date_helper \- standard Rails date helper %li %code \:rails_datetime_helper \- standard Rails datetime helper Specify a date/datetime filter just like you specify any other filter: %p Default filters are defined in configuration constants %code Wice::Defaults::DEFAULT_FILTER_FOR_DATE and %code Wice::Defaults::DEFAULT_FILTER_FOR_DATETIME. By default %code \:jquery_datepicker is used for both dates and time. = show_code .row-fluid .col-md-12 = render 'grid'
ID | Title | Archived | Due Date | Added | Updated | |
---|---|---|---|---|---|---|
—
:
— : | ||||||
381-400 / 500 Alle rijen tonen | ||||||
381 | eos | No | 2016-05-12 | 2015-05-12 12:37:24 | 2015-07-17 12:37:24 | |
382 | vel nostrum | No | 2016-07-19 | 2015-06-14 12:37:24 | 2015-08-22 12:37:24 | |
383 | omnis vel delectus | No | 2016-02-17 | 2015-05-16 12:37:24 | 2015-06-22 12:37:24 | |
384 | quia | No | 2016-03-12 | 2015-05-27 12:37:24 | 2015-09-22 12:37:24 | |
385 | et tenetur | No | 2016-09-06 | 2015-04-13 12:37:24 | 2015-08-16 12:37:24 | |
386 | eveniet ipsam et | No | 2016-07-26 | 2015-03-28 12:37:24 | 2015-07-18 12:37:24 | |
387 | sed | No | 2016-07-10 | 2015-03-27 12:37:24 | 2015-07-25 12:37:24 | |
388 | aspernatur dolores vel | No | 2016-02-27 | 2015-05-26 12:37:24 | 2015-08-21 12:37:24 | |
389 | ut | No | 2016-07-23 | 2015-05-28 12:37:24 | 2015-08-30 12:37:24 | |
390 | voluptas ut et | No | 2016-05-01 | 2015-03-15 12:37:24 | 2015-07-07 12:37:24 | |
391 | aut est | No | 2016-10-21 | 2015-03-12 12:37:24 | 2015-09-10 12:37:24 | |
392 | velit vitae | No | 2016-08-27 | 2015-05-16 12:37:24 | 2015-07-15 12:37:24 | |
393 | nihil | Yes | 2016-06-18 | 2015-04-18 12:37:24 | 2015-09-24 12:37:24 | |
394 | minus facilis | No | 2016-08-04 | 2015-03-28 12:37:24 | 2015-07-12 12:37:24 | |
395 | quia nobis quidem | No | 2016-05-23 | 2015-05-24 12:37:24 | 2015-06-23 12:37:24 | |
396 | at consequatur quaerat | No | 2016-02-24 | 2015-03-29 12:37:24 | 2015-09-24 12:37:24 | |
397 | tempore ut aliquid | Yes | 2016-07-01 | 2015-06-05 12:37:24 | 2015-08-18 12:37:24 | |
398 | dolores sit | No | 2016-09-20 | 2015-03-29 12:37:25 | 2015-06-27 12:37:25 | |
399 | rerum quae | No | 2016-03-24 | 2015-04-16 12:37:25 | 2015-07-27 12:37:25 | |
400 | et voluptatibus | No | 2016-08-15 | 2015-04-23 12:37:25 | 2015-09-11 12:37:25 |