cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to config the datetimepicker to display only the year and month?

PreetiGupta
15-Moonstone

How to config the datetimepicker to display only the year and month?

How to config the datetimepicker to display only the year and month?

There is not OOTB solution for this. What are the other ways to achieve this?

4 REPLIES 4

Hi Preeti,

 

May I know the version of ThingWorx you are on? Starting from version 8.5, Date time picker widget lets you format the date OOTB. Use the new DateTime picker widget and set the FormatToken property of the widget to your desired format. Please refer to the attached screenshot.

 

If you are on the older versions of 8.4.x, please refer to the beta widgets section and find the "Date Time picker" widget and see if you have this option.

 

Best regards,

Rajesh.Screenshot_12.png

 

 

Thanks Rajesh. It works for initial display. However the requirement is to only select month and year. This BETA widget still allows them to pick a date. So its confusing. Our metric date range is beginning to end of the month.

 

Is there any other workaround?

Hi Preeti,

 

One alternative approach to this could be to have two drop down lists. One for the year drop down with +/- 5 years from the current year and the other for the moths. You can then convert this to date inside a service using java script. Since there is no OOTB option available for the date time picker for this, you might have to look into designing a custom widget extension that fits your needs if you do not prefer the first approach. I might be able to assist you with the implementation if you decide to go with the drop down list option. Please let me know if this is something you would be able to work out with.

 

Best regards,

Rajesh.

We really do not have option but to implement drop downs for month and year.

thx

Announcements


Top Tags