示例#1
0
 @Override
 public void setParameter(final String parameter) throws CrazyException {
   try {
     if (parameter.contains(" "))
       value = CrazyLightPluginInterface.DATETIMEFORMAT.parse(parameter);
     else value = CrazyLightPluginInterface.DATEFORMAT.parse(parameter);
   } catch (final ParseException e) {
     throw new CrazyCommandParameterException(0, "Date (YYYY-MM-DD [hh:mm:ss])");
   }
 }
示例#2
0
 // Date
 public static Date StringToDate(final String date, final Date defaultDate) {
   if (date == null) return defaultDate;
   try {
     return CrazyLightPluginInterface.DATETIMEFORMAT.parse(date);
   } catch (final ParseException e) {
     try {
       return OLDDATETIMEFORMAT.parse(date);
     } catch (final ParseException e1) {
       return defaultDate;
     }
   }
 }
示例#3
0
 public static String DateToString(final Date date) {
   return CrazyLightPluginInterface.DATETIMEFORMAT.format(date);
 }