vendredi 20 mai 2016

How do i parse and differentiate '4 PM' or 'PM' in a javascript string value returns? [duplicate]

I am getting sometimes '4 PM' or 'PM' for the itemDate string. if itemDate has the value of 'PM' then I should not display anything to my HTML. If i get the value as '4 PM' then I should display that time value.

itemDate = '4 PM'

itemDate ='PM'

P.S : 4 PM is an example time string and it may be 12 AM too.

How do i do the parsing using javascript for my above request?




Aucun commentaire:

Enregistrer un commentaire