Topic: How to ignore the weekend?

The idea is the following.  I have two DateTimerPickers that I use to select a date range, I want to insert a record for each day within the selected range, ignoring Saturday and Sunday.

I have already resolved to insert a record for each day within the selected range, but I need help to ignore Saturdays and Sundays, that is, the weekend.

Wen

2 (edited by derek 2021-05-08 11:27:43)

Re: How to ignore the weekend?

Hi Wen,
Maybe you can use something like this (see attached).
Just enter your 'from' and 'to' dates and click the 'generate dates' button and records (ignoring Saturdays (Day 7) and Sundays (Day 1)) are inserted into the table.
There's also a simple check to prevent duplicate dates being inserted.
Regards,
Derek.

Post's attachments

Attachment icon week days3.zip 341.15 kb, 285 downloads since 2021-05-08 

Re: How to ignore the weekend?

works perfectly, thanks for the idea.

4 (edited by Destiny 2021-05-20 15:45:45)

Re: How to ignore the weekend?

Bonjour, cet exemple est parfait pour un calendrier mais est-il possible d'avoir certains évènements en couleur (Event).
Ci joint la photo de mon planning, les lignes sélectionnées pourrait être de différentes couleurs pour mieux se repérer.

Post's attachments

Attachment icon Location.jpg 64.2 kb, 121 downloads since 2021-05-20 

Destiny

5 (edited by derek 2021-05-20 20:12:35)

Re: How to ignore the weekend?

Salut Destiny,
A few different ways to do this,  depending on what you want to do.
Please have a look at the attachment as a suggestion,
Derek.

Post's attachments

Attachment icon diary highlight.zip 343.09 kb, 241 downloads since 2021-05-20 

6 (edited by Destiny 2021-05-21 08:54:47)

Re: How to ignore the weekend?

Salut, oui voila qui est parfait, j'ai juste a choisir la couleur adéquate. La séparation des clients se fait d'un simple coup d'œil.

Pour séparer les locations d'une ligne blanche pour mieux les distinguer en plus des couleurs de ligne, cliquez sur "Générer des date" sans activer  les "datetimepicker", les dates seront ainsi séparer par une ligne blanche.

Merci Derek.

Hi, yes this is perfect, I just have to choose the right color. Separating customers is done at a glance.

To separate the rentals with a white line to better distinguish them in addition to the line colors, click on "Generate date" without activating the "datetimepicker", the dates will be separated by a white line.

Thanks Derek.

Destiny

7 (edited by derek 2021-05-21 17:05:15)

Re: How to ignore the weekend?

Salut Destiny,
Instead of using a simple checkbox to indicate whether an event should be highlighted or not, a different approach (with more features) would be to categorise each event (work, family, social etc) and then assign a color code to each category.
Because it is data driven, you can add / change categories, add / change colors etc without having to edit the program;  to access the 'categories' screen, click on the 'Category' label on Form2 (it's underlined which is how I let users know that there is functionality attached to the label).
You can also filter the tablegrid on Form1 by specific category.
Regards,
Derek.

Post's attachments

Attachment icon diary highlight2.zip 344.43 kb, 268 downloads since 2021-05-21 

Re: How to ignore the weekend?

Hi Derek, this version is even better for viewing different clients. That's great.
Thanks again Derek.

Destiny