fdo#78119 find the longest match for month name

(cherry picked from commit 624e5c34ce815af6f65ce6699ad6b3f2aa1bf0da)

Change-Id: Idad7b083ce5528f5c735f3a8bd091819bf043fc8
Reviewed-on: https://gerrit.libreoffice.org/#/c/9329
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>