cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Partisan
Post Partisan

Add DateValue on Calendar for the relevant day

I'm creating a time sheet for employees within an organisation and I want to know is it possible that whenever a employee wants to add a new date or edit a day for a specific day that it would only display the dates from that day.

For example an today is Wednesday and an employee forgot to fill out their time sheet for Monday, so once they go in to edit their Monday page ad clock in the time and date, the calendar should only show them the date for that Monday they forgot to fill in.

6 REPLIES 6
Microsoft
Microsoft

Hi @SandraAkujobi ,

 

Based on screenshots in other posts of yours, I assume that you want to set default dates of Date Pickers in each form to a specific weekday date.

 

I tested on my own side and find a way to achieve the goal:

21.jpg

You could set each Date Picker’s DefaultDate property in Monday's form to the formula like in the screenshot:

 

DateAdd(Today(),-(Weekday(Today())-2))

 

The Weekday function returns a number represents the weekday of a specific date, today is Thursday so it returns 5(Sunday is 1 by default) and the date of this Monday(in Weekday function returns 2) is today minus 3 (5-2).

 

Date Pickers in other forms should set the corresponding value of the Weekday() to replace the hard coded number in the formula. But as you said in the other post, Saturday and Sunday are of one form, this function could not be applied on that form.

 

Please reference to the doc: functions of time .

 

Hope this helps.

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it more.

I think I understand what you mean, but my only concern is where to put the formula as on the defaultdate function I have already added in a formula in regards to the button created to clock in and out, also for both clock in and out function I have two different formulas.

Also I created a new whole new app so I have one form and all the days are listed on it, so Saturday and Sunday have separate pages now.

 

Below is an image for of the formula used in the clock in defaultdate function and clock out.

Screenshot (251).pngScreenshot (252).png

Hi @SandraAkujobi ,

 

Could you please share the details about the two variables?

As you have 7 buttons, I assume that you set a variable with different values by clicking each button? If so, you could use the formula in the variable, like on Monday Button:

 

Set(VarCurrenDate, DateAdd(Today(),-(Weekday(Today())-2)))

 

 Please have a try and if have further information please let me know.

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it more.

I just tried it with the formula posted and it didn't work, I even removed the formula I had in their beforehand just to make sure and it didn't work.

That was the error message I got from the formula.That was the error message I got from the formula.

 

 Yes I set each days with variables with different values as well as using similar methods as I did for the clock in/out Monday formulas where clock in uses 

If(Form1.Mode = FormMode.New,VARCurrentDateTime, Parent.Default)

 

And clock out uses 

If(
!IsBlank(VARCurrentDateTime2),
VARCurrentDateTime2,
Parent.Default
)

 

 

Hi @SandraAkujobi ,

 

Apply the formula on the OnSelect of each Button of the day. The DatePicker's DefaultDate is no need to change still set to

 

If(Form1.Mode = FormMode.New,VARCurrentDateTime, Parent.Default)

 

But I don't know what the variable VARCurrentDateTime2 is?

 

Best regards,

Community Support Team _ Jeffer Ni

I've tried it again and it does not work. I tried it on both days so for Monday clock in start time, the date and time does not appear at all on the screen whereas on the clock out button, the date for the Monday of this current is shown but the time does not appear and once saved whats being displayed on the details page is the Monday end date date but no time and nothing on the Monday start date and time. 

 

On the Tuesday page I did the exact same thing as the Monday page, formulas are out in the same place the only thing that changed was the (Today())-2))) to a 3. Tuesday clock in date is showing the current date today which is 10th whereas the time also does not change, but for the clock out date shows the correct date for Tuesday which is the 8th and also the time does not populate either.

Below are images to show you how it looks like.  

In the view page the entry created at 10/09/2020 12:58 same for the one belowIn the view page the entry created at 10/09/2020 12:58 same for the one belowMonday PageMonday PageTuesday PageTuesday Page

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,997)