fdo#78119 find the longest match for month name

Change-Id: Idad7b083ce5528f5c735f3a8bd091819bf043fc8