Closed djmj closed 5 years ago
ZfDate is subclass of Date already.
ZfDate is mandatory as ZF Dates have a format. There are already Classes for the typical usecases e.g. ZfDateDay
there is even a ZfDateFactory that produces ZfDate for each CODE
Can you provide an example:
The idea was to allow Date as arguments instead of ZfDate in all methods. I as a programmer dont care what format zugferd uses internal. Something flexible like:
public class Header
{
public void setIssued(Date issued)
{
this.issued = ZfDate.convertTo(issued);
}
public static ZfDate convertTo(Date date)
{
if (date instanceof ZfDate)
return (ZfDate)date;
else
return new ZfDateDay(date);
}
}
In this case the default will be converted to ZfDateDay.
Further the application could provide a "default date converter" interface which could be used, in case a different default format shall be used. If this is necessary.
public Invoice(ZfDateConverter dateConverter)
I see the point. However there is no default date format. It depend a lot on the use case and the user. You have to also take into account that the lib does also parsing xmls and converting them back into the data model.
However I take that into account for the 2.0 release as this suggestion is an API break.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
A konic beginner will try to set a Date intuitive and fail little confused like:
but must create a spefific Zf instance:
There are certain date formats of zugferd this Zf structure supports. Allowing java Date could be archived by overloading the function which does the conversion internally.