I’m trying to figure out a way to format a date string that sits inside string using javascript.
The string can be:
“hello there From 2010-03-04 00:00:00.0 to 2010-03-31 00:00:00.0”
or
“stuff like 2010-03-04 20:00:00.0 and 2010-03-31 00:00:02.0 blah blah”
I’d like it to end up like:
“stuff like 4 March 2010 and 31 March 2010 blah blah”
Does anyone have any idea as to how this could be achieved?
If the date is always going to be that format, you can replace it using a regular expression:
Example at http://jsbin.com/igeti/