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 | |
---|---|---|---|---|---|---|
—
:
— : | ||||||
101-120 / 500 Alle rijen tonen | ||||||
101 | enim ullam | No | 2016-07-12 | 2015-06-03 12:37:20 | 2015-08-31 12:37:20 | |
102 | inventore eligendi voluptas | No | 2016-06-14 | 2015-06-11 12:37:20 | 2015-09-26 12:37:20 | |
103 | molestiae | No | 2016-04-01 | 2015-06-08 12:37:20 | 2015-06-23 12:37:20 | |
104 | autem | No | 2016-05-23 | 2015-06-06 12:37:20 | 2015-07-31 12:37:20 | |
105 | autem quia | Yes | 2016-06-25 | 2015-04-09 12:37:20 | 2015-07-05 12:37:20 | |
106 | laboriosam enim | No | 2016-09-12 | 2015-06-18 12:37:20 | 2015-08-31 12:37:20 | |
107 | ut | No | 2016-07-29 | 2015-04-02 12:37:20 | 2015-08-09 12:37:20 | |
108 | maxime | No | 2016-09-01 | 2015-05-21 12:37:20 | 2015-08-08 12:37:20 | |
109 | sit amet fugiat | No | 2016-02-08 | 2015-04-03 12:37:20 | 2015-06-29 12:37:20 | |
110 | hic | No | 2016-01-11 | 2015-05-11 12:37:20 | 2015-09-12 12:37:20 | |
111 | sit ea | Yes | 2016-04-07 | 2015-06-03 12:37:20 | 2015-08-17 12:37:20 | |
112 | neque qui | No | 2016-02-25 | 2015-04-05 12:37:20 | 2015-07-19 12:37:20 | |
113 | exercitationem | No | 2016-05-28 | 2015-04-02 12:37:20 | 2015-07-19 12:37:20 | |
114 | dolores libero | No | 2016-05-27 | 2015-06-08 12:37:20 | 2015-07-03 12:37:20 | |
115 | sit et est | No | 2016-08-14 | 2015-03-16 12:37:20 | 2015-09-09 12:37:20 | |
116 | dolorem consectetur | No | 2016-09-07 | 2015-05-17 12:37:20 | 2015-07-24 12:37:20 | |
117 | fugit | No | 2016-02-12 | 2015-04-02 12:37:20 | 2015-08-24 12:37:20 | |
118 | hic | No | 2016-06-07 | 2015-03-25 12:37:20 | 2015-07-04 12:37:20 | |
119 | quo est aliquid | No | 2016-03-22 | 2015-05-19 12:37:20 | 2015-09-01 12:37:20 | |
120 | esse voluptas deserunt | No | 2016-08-01 | 2015-05-07 12:37:20 | 2015-07-06 12:37:20 |