Ad
  • Custom User Avatar

    Who needs regex. ;-) Actually there's no need to apply a "fix" when you figure out how many components the result will consist of before building it and use " and " to separate the two final components regardless of what they are (days, hours, ...).

  • Custom User Avatar

    Try a regex that targets that last ',' and replace it in the formatted string or use lastIndexOf(',') to the same effect.