I see multiple solutions that only work for EN based locales. i.e. Replacing AM with a.m.
Adding tests for other locales would increase the learning for this task.