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

Conversion date Error Launchpad

0 Likes
1,175

Hello,

I have a problem concerning the format of a date, when I am logged on the launchpad in French, I have the months and days reversed so when I put a date such as December 23, 2022 (23/12/2022), I am told that the format is not correct. ( in English it works I dont have a conversion error )

My XML View

<DatePicker id="_IDDatePicker5" 
            change="additionalInfoValidation1" 
            placeholder="{i18n>PBirthDate}" 
            class="sapUiSmallMarginBottom"/> 

My Contoller

var BirthName = this.byId("_IDInput3-2").getValue();
var TrueBirthDate = new Date(BirthDate);
TrueBirthDate.setUTCHours(24);
var oPayLoad = { "BirthDate" : TrueBirthDate, };
this.getOwnerComponent().getModel().create("/Licence", oPayLoad, {success: function (odata, Response) {if (odata !== "" || odata !== undefined ) { MessageBox.success("Created successfully."); that.startWorkflowInstance(oPayLoad); } else { MessageBox.error("New entry not created."); } }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); alert(xhr.responseText); } }); }; );
  

I use a BTP Trial account

Has anyone had the same problem?

If you have more information don't hesitate to mention it in comment

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
SAP Champion
SAP Champion

using getDateValue() from the control, no need new Date(***)

it should go through, though you may have date shifted one day issue.

0 Likes

Thank you so much !! it did solve my problem 🙂

gregorw
SAP Mentor
SAP Mentor

Don't forget to accept the question.