gitpab icon indicating copy to clipboard operation
gitpab copied to clipboard

Get a result of a range based on for which day it was provided.

Open lisovsk opened this issue 6 years ago • 7 comments

When we provide a range can we get the result based on for which day it was provided instead when it was provided? http://prntscr.com/merjik It will be more useful. I really thank you for helping me out.

lisovsk avatar Jan 31 '19 13:01 lisovsk

Currently you can find provided spent time in csv (column spent_at):

image

I use date when it was provided in interface, because this approach exclude manipulations with spent time in past.

mnvx avatar Feb 02 '19 18:02 mnvx

In my case for a specific range I want to now all spent_at times. For that I need a result based on for which day it was provided. Is it hard to fix? Can you explain how fix that?

lisovsk avatar Feb 05 '19 16:02 lisovsk

I think it is better to

  • add new filter "Spent At" (filter by spent_at column)
  • rename current column "Spent at" to "Created at"
  • add new column "Spent at" with date from column spent_at

It is not hard. Must be changed next places:

  • repository SpentRepositoryEloquent::getListQuery() - add filter by spent_at by analogue with note.gitlab_created_at
  • view gitpab/time/index_filter_form.blade.php - add filter control (range)
  • view gitpab/time/index_table.blade.blade.php - rename old column and add new column

mnvx avatar Feb 05 '19 20:02 mnvx

How can I add column with spent_at? I thought I could do it that way - http://prntscr.com/n9keph

lisovsk avatar Apr 09 '19 12:04 lisovsk

If you don't plan to push changes, it is simplest way, yes.

If you plan to push changes into this repo, solution described above is recomendated

mnvx avatar Apr 09 '19 12:04 mnvx

I went through the simplest way but It show date for - gitlab created_at

lisovsk avatar Apr 09 '19 14:04 lisovsk

You need to replace next line to {{ \App\Helper\Date::formatDateTime($item->spent_at) }}

And for orderings:

Replace next line to 'column' => 'spent.spent_at',

Also add line 'spent.spent_at', into this array

mnvx avatar Apr 10 '19 20:04 mnvx