Question

I have a requirement where I need to display a Date field in Dropdown mode. However on load of the screen, Month and Day will remain blank but the year should get set as the current year. I have tried to use the Default value with the CurrentDateTime func

I have a requirement where I need to display a Date field in Dropdown mode. However on load of the screen, Month and Day will remain blank but the year should get set as the current year. I have tried to use the Default value with the CurrentDateTime function but it is displaying all i.e. Month Day and Year. I have tried to convert the current date time into BigDecimal and then get it converted to the Year. Used the following: @(Pega-RULES:DateTime).year(@(Pega-RULES:DateTime).dateTimeToBigDecimal(@(Pega-RULES:DateTime).CurrentDateTime(), DateTime, tools)). But not working.

Message was edited by: Marissa Rogers - added category, moved from Mesh Help

  1. Edit posts to add this mod edit message: Note the bold font of the message

***Updated by moderator: Marissa to close post***

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

Pega
May 19, 2016 - 10:54am

Hi Nabendu,

You said "However on load of the screen, Month and Day will remain blank but the year should get set as the current year. ""

I think if you use  calendar control with drop down then it will by default load with all blanks ( Screenshot below ) .

Do you want something similar ?

date time.png

May 19, 2016 - 11:20am
Response to Santanu

Hi Shantanu,

Thanks for the update. That's the basic need. That we have already implemented. However, the requirement is when I click on the Year dropdown , it should show the current Year.

Pega
May 19, 2016 - 11:37am
Response to NabenduP

Hi Nabendu

If you want to default it to current year and dont want to give option for previous year then you can set past year range as 0 in the presentation tab of the date time control.

display range.png

May 19, 2016 - 12:39pm
Response to Santanu

Hi Shantanu,

I have to show past years as well

Pega
May 20, 2016 - 6:40am
Response to NabenduP

Hi Nabendu,

I am not sure whether this is doable via OOTB DateTime control.

Few alternatives could be to use regular drop down control and use datapage to populate the years and set the CURRENT year as default value accordingly.

May 27, 2016 - 5:19am
Response to Santanu

Hi Santanu,

It seems like is not possible through the OOTB control. We are trying to make the client understand if they can change the requirement. Since this is already in Prod environment, we cant take risk to change the entire implementation on the Dates.

Pega
May 27, 2016 - 5:22am
Response to NabenduP

Thanks for letting us know about it.

September 8, 2016 - 6:55pm
Response to Santanu

HI Santanu,

 

We are useing PEGA 7.1.8 and we dont see the display Range option in the presentation tab of dateTime Control. 

We just see the NumberofYears Option in the Date Time COntrol.

Is the Display range specific to any Latest PEGA Versions?

November 24, 2017 - 7:35am
Response to Santanu

Hi Santanu,

Is there a way to display it as past 3 months..instead of year?

June 13, 2017 - 1:37pm

We have the same requirement. Were you able to achieve this behavior ?

June 21, 2017 - 6:56am
Response to MANASA

Hello!

Thank you for posting your query in the PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write a Post button that’s available on the top right pane of this page. Once created, please reply back here with the URL of the new post.

We have also sent you a private message opening up a communication channel in case you have any further questions.

Vidyaranjan | Community Moderator | Pegasystems Inc.

May 21, 2018 - 7:10am