score:0

Accepted answer

you have to update your function like this. simply you have to add { instead of ( and set return inside the function.

userfriendlydate = (selecteddate) => {
    let startmonth = this.dateutil.translatemonthshort(selecteddate.getmonth())

    return selecteddate
      ? [startmonth, selecteddate.getfullyear(),
       startmonth].join(' ')
      : ' '
  }

hope this will help you!

score:0

can you post the error? i suspect it might be because of your parens

userfriendlydate = (selecteddate) => (

try curly braces instead.

userfriendlydate = (selecteddate) => {

the paren is for a multi-line return statement. inside the block (when you use {) you'll need to add a return


Related Query

More Query from same tag