cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to set current date as default date in date picker everytime page loads

How to set current date as default date in date picker everytime page loads?

14 REPLIES 14
Anonymous
Not applicable

Hi,

 

But my customised Form only has one screen and items are added on sharepoint list and viewed from sharepoint list. 

When trying to view previous requests the datepicker is changing to today's date.

 

Thanks,

MK

 

In your case then you'd reference the mode of the SharePoint form:

If(
    SharePointForm1.Mode = FormMode.New,
    Today(),
    Parent.Default)

The mode property of that form will vary depending on whether it's being used to add a new item or to edit an existing one.

alikhan_3
New Member

how can get timestamp in date picker?

Set DefaultDate of Date Picker to:

Now()

That should be 

UpdateContext({currentDate: Today() - 1}); UpdateContext({currentDate: Today()});

not a comma after currentDate:

UpdateContext({currentDate: Today() - 1}); UpdateContext({currentDate, Today()});

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (21,683)