@@ -0,0 +1,1821 @@
+package dk.statsbiblioteket.doms.transformers.common;%0A%0Aimport java.util.Date;%0Aimport java.util.GregorianCalendar;%0A%0Aimport javax.xml.datatype.DatatypeFactory;%0Aimport javax.xml.datatype.XMLGregorianCalendar;%0A%0Apublic class CalendarUtils %7B%0A%0A    /**%0A     * Private constructor. %0A     */%0A    private CalendarUtils() %7B%7D%0A    %0A    /**%0A     * Creates a Date object from the string representation of unixtime in seconds. %0A     * @param unixTime the unixtime. If the argument is null, then epoch is returned. %0A     */%0A    public static Date getDate(String unixTime) %7B%0A        Date date;%0A        %0A        if(unixTime == null) %7B%0A            date = new Date(0);%0A        %7D else %7B%0A            date = new Date(Long.parseLong(unixTime)*1000);%0A        %7D%0A        return date;%0A    %7D%0A    %0A    /**%0A     * Turns a string representation of unix time into a XMLGregorianCalendar.%0A     * @param unixTime The unixtime. If the argument is null, then epoch is returned.%0A     * @return The XMLGregorianCalendar.%0A     */%0A    public static XMLGregorianCalendar getXmlGregorianCalendar(String unixTime) %7B%0A        return getXmlGregorianCalendar(getDate(unixTime));%0A    %7D%0A    %0A    /**%0A     * Turns a date into a XMLGregorianCalendar.%0A     * @param date The Date. If the argument is null, then epoch is returned.%0A     * @return The XMLGregorianCalendar.%0A     */%0A    public static XMLGregorianCalendar getXmlGregorianCalendar(Date date) %7B%0A        if(date == null) %7B%0A            date = new Date(0);%0A        %7D %0A        %0A        GregorianCalendar gc = new GregorianCalendar();%0A        try %7B%0A            gc.setTime(date);%0A            return DatatypeFactory.newInstance().newXMLGregorianCalendar(gc);%0A        %7D catch (Exception e) %7B%0A            throw new IllegalStateException(%22Could not convert the date '%22 + date + %22' into the xml format.%22, e);%0A        %7D%0A    %7D%0A%7D%0A

Add CalendarUtils class to common module