You need to sign in to do that
Don't have an account?
Sujendran Sundarraj 8
$A.localizationService.formatDate doesnot set the proper value to lightning:inputfield
Hello,
I have an issue with Lightning:inputfield with date datatype. I want to autopopulate the close date value i.e 90 days from today.
to acheive this I have used $A.localicationService.formatDate(mydate);
it shows the correct date in UI but it dont set that date properly in the field.
Any idea is appreciated.
Thank you.
I have an issue with Lightning:inputfield with date datatype. I want to autopopulate the close date value i.e 90 days from today.
to acheive this I have used $A.localicationService.formatDate(mydate);
it shows the correct date in UI but it dont set that date properly in the field.
Any idea is appreciated.
Thank you.
What is the value you are passing? Does the approach suggested in https://salesforce.stackexchange.com/questions/266502/localizationservice-formatdatetime-method-is-not-displaying-correct-time-in-euro work for your scenario?
If this information helps, please mark the answer as best.Thank you
Thank you for your reply, my business requirement is close date should be autopopulated with today()+90 days. and if the user wants to change it, they can change to any dates
my Js controller: in the screen, I could see the value in the lightning:inputfield as apr 5,2021 but the problem is if I click inside that date field and if I didnot change any value then it is throwing an validation error: "Your entry doesnot match the allowed format MMM d, YYYY."
instead of using $A.localizationService, if I use new Date(today) in my Js. it is not showing the value in the inputfield screen but the value is assigned to that field I could see it through console.log
Thank you.