问题
I have an events website that displays plain text dates in a rather verbose manner, as shown below.
August 10th, 08:00AM - August 10th 08:15AM
How can I use Javascript to make this less verbose?
Something like this...
August 10th, 08:00AM - 08:15AM
To be clear the actual dates are generated and could be anything, so I suspect this problem is more than a simple character replacement thing. Nor does it follow that the date would be the same as it is in example.
I can probably rely on the character spaces and where they will be.
More Info
This is a Drupal field which is outputting a start and and end date using the same PHP date/time formatting.
Unfortunately the developer has not implemented a way of formatting the end date differently or for what treatment can be applied if the start and end date are different.
来源:https://stackoverflow.com/questions/63397859/how-do-i-make-this-date-string-less-verbose