Feature #6806 » add_accounting_datetime_filters.patch
| app/controllers/timelog_controller.rb | ||
|---|---|---|
| 238 | 238 |
when '7_days' |
| 239 | 239 |
@from = Date.today - 7 |
| 240 | 240 |
@to = Date.today |
| 241 |
when 'before_current_week' |
|
| 242 |
@from = TimeEntry.earilest_date_for_project(@project) || Date.today |
|
| 243 |
@to = Date.today - 1 - (Date.today.cwday - 1) % 7 |
|
| 244 |
@from = @to if @from > @to |
|
| 241 | 245 |
when 'current_month' |
| 242 | 246 |
@from = Date.civil(Date.today.year, Date.today.month, 1) |
| 243 | 247 |
@to = (@from >> 1) - 1 |
| ... | ... | |
| 247 | 251 |
when '30_days' |
| 248 | 252 |
@from = Date.today - 30 |
| 249 | 253 |
@to = Date.today |
| 254 |
when 'before_current_month' |
|
| 255 |
@from = TimeEntry.earilest_date_for_project(@project) || Date.today |
|
| 256 |
@to = Date.civil(Date.today.year, Date.today.month, 1) - 1 |
|
| 257 |
@from = @to if @from > @to |
|
| 250 | 258 |
when 'current_year' |
| 251 | 259 |
@from = Date.civil(Date.today.year, 1, 1) |
| 252 | 260 |
@to = Date.civil(Date.today.year, 12, 31) |
| app/helpers/timelog_helper.rb | ||
|---|---|---|
| 73 | 73 |
options_for_select([[l(:label_all_time), 'all'], |
| 74 | 74 |
[l(:label_today), 'today'], |
| 75 | 75 |
[l(:label_yesterday), 'yesterday'], |
| 76 |
[l(:label_before_this_week), 'before_current_week'], |
|
| 76 | 77 |
[l(:label_this_week), 'current_week'], |
| 77 | 78 |
[l(:label_last_week), 'last_week'], |
| 78 | 79 |
[l(:label_last_n_days, 7), '7_days'], |
| 80 |
[l(:label_before_this_month), 'before_current_month'], |
|
| 79 | 81 |
[l(:label_this_month), 'current_month'], |
| 80 | 82 |
[l(:label_last_month), 'last_month'], |
| 81 | 83 |
[l(:label_last_n_days, 30), '30_days'], |
| config/locales/da.yml | ||
|---|---|---|
| 477 | 477 |
label_all_time: altid |
| 478 | 478 |
label_yesterday: i går |
| 479 | 479 |
label_this_week: denne uge |
| 480 |
label_before_this_week: "før denne uge" |
|
| 480 | 481 |
label_last_week: sidste uge |
| 481 | 482 |
label_last_n_days: "sidste {{count}} dage"
|
| 482 | 483 |
label_this_month: denne måned |
| 484 |
label_before_this_month: "før denne måned" |
|
| 483 | 485 |
label_last_month: sidste måned |
| 484 | 486 |
label_this_year: dette år |
| 485 | 487 |
label_date_range: Dato interval |
| config/locales/en.yml | ||
|---|---|---|
| 595 | 595 |
label_all_time: all time |
| 596 | 596 |
label_yesterday: yesterday |
| 597 | 597 |
label_this_week: this week |
| 598 |
label_before_this_week: before this week |
|
| 598 | 599 |
label_last_week: last week |
| 599 | 600 |
label_last_n_days: "last {{count}} days"
|
| 600 | 601 |
label_this_month: this month |
| 602 |
label_before_this_month: before this month |
|
| 601 | 603 |
label_last_month: last month |
| 602 | 604 |
label_this_year: this year |
| 603 | 605 |
label_date_range: Date range |
| config/locales/no.yml | ||
|---|---|---|
| 466 | 466 |
label_all_time: all tid |
| 467 | 467 |
label_yesterday: i går |
| 468 | 468 |
label_this_week: denne uken |
| 469 |
label_before_this_week: "før denne uken" |
|
| 469 | 470 |
label_last_week: sist uke |
| 470 | 471 |
label_last_n_days: "siste {{count}} dager"
|
| 471 | 472 |
label_this_month: denne måneden |
| 473 |
label_before_this_month: "før denne måneden" |
|
| 472 | 474 |
label_last_month: siste måned |
| 473 | 475 |
label_this_year: dette året |
| 474 | 476 |
label_date_range: Dato-spenn |