Show column with day of the week (Monday, Tuesday...)

Discussion related to "Everything" 1.5 Alpha.
Post Reply
David.P
Posts: 200
Joined: Fri May 29, 2020 3:22 pm

Show column with day of the week (Monday, Tuesday...)

Post by David.P »

Hello Forum,

is there a possibility to show a column that contains the day of the week? For example, the date in long format according to the Windows settings, or an additional column that contains only the day of the week?

Best regards
David
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: Show column with day of the week (Monday, Tuesday...)

Post by void »

Please try the following date_format:
  • In Everything 1.5, from the Tools menu, click Options.
  • Click the Advanced tab on the left.
  • To the right of Show settings containing, search for:
    date
  • Select date_format.
  • Set the value to: dddd, d MMMM yyyy
  • Click OK.
date_format



Please consider the following custom column:

Code: Select all

addcolumn:a a-label:="Day of Week" a:=switch(weekday($date-modified:),0,"Sunday",1,"Monday",2,"Tuesday",3,"Wednesday",4,"Thursday",5,"Friday",6,"Saturday")
(this search adds a custom "Day of Week" column and shows the dayname from the date modified)

Column Formulas
David.P
Posts: 200
Joined: Fri May 29, 2020 3:22 pm

Re: Show column with day of the week (Monday, Tuesday...)

Post by David.P »

Awesome, that works perfectly!
Thank you very much!

Best Regards
David
hamid56
Posts: 26
Joined: Sun Jul 20, 2014 9:38 am

Re: Show column with day of the week (Monday, Tuesday...)

Post by hamid56 »

Dear David
can you more explain about how work above formula?
i was thinking that it is not possible to formulate day of week for any date
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Show column with day of the week (Monday, Tuesday...)

Post by NotNull »

The WEEKDAY($date-modified:) column formula will report the day of the week of the file's date-modified as a number (0=Sunday ... 6=Saturday).

The SWITCH() column formula will "translate" this number to a textual format: If the value is 0, show Sunday, etc.

Written a little different for more clarity:

Code: Select all

switch(weekday($date-modified:),
  0,"Sunday",
  1,"Monday",
  2,"Tuesday",
  3,"Wednesday",
  4,"Thursday",
  5,"Friday",
  6,"Saturday"
)



BTW: another way to get the same results:

Code: Select all

add-column:column-A   A-label:="Weekday"   A:=formatfiletime($date-modified:,DDDD)
This will show the day of the week, however it will be localized, like Dimanche instead of Sunday on a French language Windows version.
(not tested though)

For more information about the DDDD syntax, follow the date_format link as posted by @void.
Last edited by void on Tue Oct 24, 2023 2:26 am, edited 1 time in total.
Reason: edit: A-label:=
hamid56
Posts: 26
Joined: Sun Jul 20, 2014 9:38 am

Re: Show column with day of the week (Monday, Tuesday...)

Post by hamid56 »

so thanks NotNull
sk2107
Posts: 325
Joined: Sun Aug 07, 2022 8:48 pm

Re: Show column with day of the week (Monday, Tuesday...)

Post by sk2107 »

Hello,
U used this syntax "add-column:column-A A-label:="Weekday" A:=formatfiletime($date-modified:,DDDD)"
which is very cool, but I noticed that in the list the header comes as "Weekday" but in export to csv it comes as "Column A"

Is there a fix for this?

Thank you
Best Regards
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Show column with day of the week (Monday, Tuesday...)

Post by NotNull »

Currently not. I vaguely remember that @void would look into this later.
sk2107
Posts: 325
Joined: Sun Aug 07, 2022 8:48 pm

Re: Show column with day of the week (Monday, Tuesday...)

Post by sk2107 »

thank you for your rapid reply.

Best regards
Post Reply