Date Display

  

Hey, guys, I've read a lot about this topic but I am not sure which one is for me. Like if I need to change it in the environtmnet or if I can just change it on the page.


I am trying to display the date in the format (MM-DD-YYYY).


In the RichWidgets/Calender_Input i have the DateFormat as "%m-%d-%Y"

However, when you select a date and save. It saves it as the null date #1900-01-01#

If I type in the date 2018-05-29. It will then save the date to that MemberId like it's suppose to.


Any idea what would cause this?



It refuses to save information to a memberId in any other format than this right here.

Solution

Hi Jared,


If you need to have this format of date throuh out the appplication than configure it in Service center


Administration >> Enviornment Configuration >> Date Format


However if you want to have this date format in any specific page only then change your input widget 

variable to text and at the time of save convert it into Date


Hope that would work


Regards

Devendra

Solution

Hi Jared,

Just adding to what Devendra  has said:

  • The change in service center will affect all applications
  • And you should republish everything so that you do not get any runtime errors.

Cheers,

José

Thanks guys, that fixed it. Changing the Entities to data type Text instead of leaving them at data type Date.

By the way, one more question regarding this. 

When i change the Date Format in the Calender_InputWidget - I see 


DD-%b-YYYY


How do I stop that %b from showing when there is no date in the Calender box for that employee? I want it to show DD-MON-YYYY or something similar instead of DD-%b-YYYY

Jared Davis wrote:

Thanks guys, that fixed it. Changing the Entities to data type Text instead of leaving them at data type Date.

Doing this might have undesired consequences, like now if you want to compare dates you have to make extra conversions on your aggregates that might be expensive. The problem you were facing is a UX/data input problem, shouldn't have this sort of impact on your data model (you want to think about dates, not text that you expect to represent a date)


Jared Davis wrote:

How do I stop that %b from showing when there is no date in the Calender box for that employee? I want it to show DD-MON-YYYY or something similar instead of DD-%b-YYYY

Can't remember how much the Calendar_Input highjacks the standard Input Widget it's bound to but, in general, I'd just type what I want to be displayed as example in the Prompt of the Input Widget.


Thanks so much for all the input and help fellas. I ultimately just decided to switch the default date in the environment and am much happier with it. Thank you very much for the help.