Bug 11244: Add unit tests for GetPreparedLetter

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11244: notices ignoring the dateformat preference

Overdue notices are using the MySQL date format and not the dateformat
in the system preferences.

Test Plan:
1) Enable checkout notices for a patron, make sure the date due is in
   the notice.
2) Check out an item to that patron, note the date is in the mysql
   datetime format
3) Apply this patch
4) Check out another item to the patron, not the date is now in the
   preferred date format.

Signed-off-by: David Cook <dcook@prosentient.com.au>

I love this patch! It is the best solution to this problem that I've
seen. I think it is set up to perfectly handle dates in the notices.

Unfortunately, the $dateonly flag is backwards, so the time is stripped
from timestamps and 00:00:00 is added to dates without times.

I'm adding a follow-up to reverse the setting of this flag.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11244: (follow-up) Fix $dateonly flag

At the moment, $dateonly is set to true when $1 is defined. However,
since the regex capture group only includes the time, this flag will
only be set when there is a value that includes a time.

In effect, this means that timestamps are reduced to dates only,
while dates have 00-00-0000 added to them.

This patch keeps the logic but reverses the values, so that $dateonly
will default to true unless $1 is defined.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>