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 | |
---|---|---|---|---|---|---|
—
:
— : | ||||||
121-140 / 500 Alle rijen tonen | ||||||
121 | dolore id | No | 2016-03-02 | 2015-06-15 12:37:20 | 2015-07-31 12:37:20 | |
122 | omnis | No | 2016-09-05 | 2015-03-25 12:37:20 | 2015-07-08 12:37:20 | |
123 | suscipit sunt deserunt | No | 2016-03-20 | 2015-05-27 12:37:20 | 2015-07-23 12:37:20 | |
124 | earum | No | 2016-05-14 | 2015-06-08 12:37:20 | 2015-06-28 12:37:20 | |
125 | nihil eum minus | No | 2016-03-04 | 2015-04-29 12:37:20 | 2015-09-15 12:37:20 | |
126 | qui voluptatum atque | No | 2016-02-22 | 2015-04-06 12:37:20 | 2015-07-18 12:37:20 | |
127 | doloribus ut | No | 2016-07-24 | 2015-06-06 12:37:20 | 2015-06-28 12:37:20 | |
128 | voluptas | No | 2016-05-31 | 2015-05-05 12:37:20 | 2015-07-13 12:37:20 | |
129 | voluptates minima molestiae | No | 2016-10-16 | 2015-05-03 12:37:20 | 2015-07-07 12:37:20 | |
130 | esse ratione | No | 2016-04-14 | 2015-04-08 12:37:20 | 2015-06-25 12:37:20 | |
131 | iure autem amet | No | 2016-08-06 | 2015-05-05 12:37:20 | 2015-09-15 12:37:20 | |
132 | quia | No | 2016-04-26 | 2015-03-17 12:37:20 | 2015-08-08 12:37:20 | |
133 | optio | No | 2016-10-03 | 2015-03-27 12:37:20 | 2015-08-28 12:37:20 | |
134 | impedit voluptas eligendi | No | 2016-08-26 | 2015-05-10 12:37:20 | 2015-08-11 12:37:20 | |
135 | dignissimos id | No | 2016-08-17 | 2015-04-11 12:37:20 | 2015-09-13 12:37:20 | |
136 | exercitationem distinctio qui | No | 2016-04-01 | 2015-03-14 12:37:20 | 2015-08-01 12:37:20 | |
137 | molestiae | Yes | 2016-01-30 | 2015-06-12 12:37:20 | 2015-09-14 12:37:20 | |
138 | sint qui | No | 2016-03-09 | 2015-06-01 12:37:20 | 2015-07-01 12:37:20 | |
139 | aliquid odit | No | 2016-10-11 | 2015-04-19 12:37:20 | 2015-07-05 12:37:20 | |
140 | mollitia | No | 2016-10-06 | 2015-05-21 12:37:20 | 2015-08-26 12:37:20 |