Issue with accepting date format.

Dear community!

I have a small issue I think could have an easy fix, just don't know how to get to it at this point.

So I want the below date to be accepted as a "Date" format, since I need to sort on date later on. It will only accept this screen when post as "Text" in the entity attribute. However, this does not allow for proper sorting on date (i.e. most recent etc.). 


Is there any way in which I can use the Date format and this format of date in which it will accept?

Please let me know if my query is not clear enough. It goes without saying that I used to OSMDb app as a sample to show my issue that is work related.

Could not find a similar fix to this issue on the community, if there is please let me know.

Any help is very much appreciated!

Kind regards

Boyan

Hi Boyan,

When date is formatted by calendar widget it becomes text data type.

Try to set new variable with text data type in input and then convert it to date variable considering its format.

Hi Boyan Algra ,

Did you try to do this, because your problem is about date format. Check your entity and the attribute data type of birthday. I send you some pics of how you can solve this.


The variable you are using is of type Date, I'm assuming you made the validation of the button to the server to be able to pass the client validation but when you get on the server the form is invalid and you cant save


Nuno Miguel Verdasca wrote:

Hi Boyan Algra ,

Did you try to do this, because your problem is about date format. Check your entity and the attribute data type of birthday. I send you some pics of how you can solve this.



Hi Nuno,

Thank you for your quick reply. I have the setting exactly as how you send it. Which is the reason why I cannot save the Date that is being interpreted as Text. However, I would need this exact format to be saved as a Date format. So, I am thinking about something along the lines of converting to a Date format, just not entirely sure how to do this.

Daryna Kravets wrote:

Hi Boyan,

When date is formatted by calendar widget it becomes text data type.

Try to set new variable with text data type in input and then convert it to date variable considering its format.

Hi Daryna

Good to know! That sounds like a logical solution. Could you further assist in how to exactly convert this to one another?


Carlos Lessa wrote:

The variable you are using is of type Date, I'm assuming you made the validation of the button to the server to be able to pass the client validation but when you get on the server the form is invalid and you cant save


Hi Carlos

Thank you for your reply. That is indeed correct, it seems I should either change the attribute to text and then I will be able to save it. However, I would then convert it back to a date so I am able to sort on a date format. Would that make sense? As this format cannot in either way be accepted as a date.

Thanks!


Boyan Algra wrote:

Nuno Miguel Verdasca wrote:

Hi Boyan Algra ,

Did you try to do this, because your problem is about date format. Check your entity and the attribute data type of birthday. I send you some pics of how you can solve this.



Hi Nuno,

Thank you for your quick reply. I have the setting exactly as how you send it. Which is the reason why I cannot save the Date that is being interpreted as Text. However, I would need this exact format to be saved as a Date format. So, I am thinking about something along the lines of converting to a Date format, just not entirely sure how to do this.


Please, check my OAP maybe it will more easy.
But maybe the problem is about your dateformat in the calendar richwidget.

Check, and let me know.

Nuno Miguel Verdasca wrote:

Boyan Algra wrote:

Nuno Miguel Verdasca wrote:

Hi Boyan Algra ,

Did you try to do this, because your problem is about date format. Check your entity and the attribute data type of birthday. I send you some pics of how you can solve this.



Hi Nuno,

Thank you for your quick reply. I have the setting exactly as how you send it. Which is the reason why I cannot save the Date that is being interpreted as Text. However, I would need this exact format to be saved as a Date format. So, I am thinking about something along the lines of converting to a Date format, just not entirely sure how to do this.


Please, check my OAP maybe it will more easy.
But maybe the problem is about your dateformat in the calendar richwidget.

Check, and let me know.

Yeah the problem is indeed the dateformat. The calender richwidget converts to text when I set it to the format I need. What I would need is something that can conver this back to a date I think!


I'm glad I helped to identify your problem :)