How do I make a date selector like this?

I’m trying to make a date selector that does the following:

  • The current week is displayed, and each day of that week is displayed.
  • The current day is selected by default.
  • You can select a day to view by clicking on a day.

Please see the attached picture for a visual of what I mean - it should make things more clear.

There’s more i’d like to do, but I’m hoping to start here.

What i’ve tried so far is to create a repeating group that has 7 columns to simulate the days. But I can’t figure out how to make them the days of the current week. I tried creating a Weeks and Days in my database, but I couldn’t figure it out, and I don’t want to have to manually create weeks and days anyway.

Can anyone give me any hints on what I should try? Is this possible?

If all the time you have the current week you can do fixed instead use repeating group for days selection. If you are considering Sunday the first day of the week, all the time you have to have sunday for the same element, you have only to calculate the week days correspondent to week that you are show.