w2l: Two minor changes to EPUB export to avoid validation errors from FlightCrew
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@134 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
90d1b47551
commit
fdf0488bd7
6 changed files with 30 additions and 17 deletions
|
@ -16,11 +16,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Copyright: 2002-2011 by Henrik Just
|
||||
* Copyright: 2002-2012 by Henrik Just
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2011-03-29)
|
||||
* Version 1.2 (2012-02-26)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -60,6 +60,20 @@ public class Misc{
|
|||
return newArray;
|
||||
}
|
||||
|
||||
// Truncate a date+time to the date only
|
||||
public static final String dateOnly(String sDate) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
||||
Date date = null;
|
||||
try {
|
||||
date = sdf.parse(sDate);
|
||||
} catch (ParseException e) {
|
||||
// If the date cannot be parsed according to the given pattern, return the original string
|
||||
return sDate;
|
||||
}
|
||||
// Return using a default format for the given locale
|
||||
return sDate.substring(0,10);
|
||||
}
|
||||
|
||||
public static final String formatDate(String sDate, String sLanguage, String sCountry) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
||||
Date date = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue