am dd508581: Use min when comparing AM and PM text lengths

* commit 'dd508581216ef3ef47bd474316232f269db43f03':
  Use min when comparing AM and PM text lengths