Date format in form...
 
Notifications
Clear all

Date format in forms


David Alonso
(@david-alonso)
New Member
Joined: 2 months ago
Posts: 3
Topic starter  

How can I set the date format for date fields in forms?


Quote
admin
(@admin)
Member Admin
Joined: 3 years ago
Posts: 25
 

Hi David,

As far as I know, in an online application the date will be displayed according the settings of the users browser. So this will be different according the country the user lives. 

I will check if you can 'force' this? With BOA the iAPI can send a STYLE and PIPE for each element. So in the same form, each element can have another style as color, font, .... With the PIPE you can set the date format. 

See https://angular.io/guide/pipes for more info about pipes.

I will test it and come back to you with a sample.

Best regards,

Chris.

 

This post was modified 2 months ago by admin

ReplyQuote
admin
(@admin)
Member Admin
Joined: 3 years ago
Posts: 25
 

Hi David,

Meanwhile I thought about your question. The answer is dependant of 'what do you want to accomplish?'.

Using pipes won't do anything for the input of dates. This is how it is defined in the Angular documentation.

Use pipes to transform strings, currency amounts, dates, and other data for display. 

Important here is: for display! It is not for the input of the date, it is only to display it. And in that case, it is up to the iApi to define the format of the date when sending the response with data. If you want a date displayed in a specific format, you can send it in that format.

About the input of the date in a form. This is shown in the format of the browser. If you enter a date that is not possible, you will see a warning message, which will show the format that is expected.

When using the element DATE with BOA, there will be a button to select the date (see attachment). This shows a calendar to search and select.

Best regards,

Chris.

 


ReplyQuote
Share: