You need to sign in to do that
Don't have an account?
VRK
TimeZone issues in lighitng
Hi Team,
i am getting issue in Time zone for below my requirement : could you pls help on this:
if(!$A.util.isUndefinedOrNull(effectiveDate)){
effectiveDate.setMonth(11);
effectiveDate.setDate(31);
}
effectiveDate = new Date(effectiveDate);
if(!$A.util.isUndefinedOrNull(effectiveDate)){
effectiveDate.setFullYear(effectiveDate.getFullYear() + 1);
effectiveDate.setDate(effectiveDate.getDate() - 1);
}
When i try to execute code , i am getting some times Date as
12/31/2020
or
01/01/2021
But i need 12/31/2020.
I know its related to Time zone ....
Can you pls help anyone this .
Thanks
VRK
i am getting issue in Time zone for below my requirement : could you pls help on this:
if(!$A.util.isUndefinedOrNull(effectiveDate)){
effectiveDate.setMonth(11);
effectiveDate.setDate(31);
}
effectiveDate = new Date(effectiveDate);
if(!$A.util.isUndefinedOrNull(effectiveDate)){
effectiveDate.setFullYear(effectiveDate.getFullYear() + 1);
effectiveDate.setDate(effectiveDate.getDate() - 1);
}
When i try to execute code , i am getting some times Date as
12/31/2020
or
01/01/2021
But i need 12/31/2020.
I know its related to Time zone ....
Can you pls help anyone this .
Thanks
VRK
Use formatDate method in your controller
Posting some examples here:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_format_dates.htm
If you find this answer helpful, please mark this as Best Answer so that it can help others in the community. Thank You!
Anudeep