update parseCVS with default English locale

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137582 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Caswell 2003-08-10 13:32:16 +00:00
parent f325bbd0d3
commit 4332582e88
1 changed files with 2 additions and 14 deletions

View File

@ -74,7 +74,7 @@
* @author Janek Bogucki
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
* @since 2.0
* @version $Id: DateUtils.java,v 1.10 2003/08/06 21:13:39 ggregory Exp $
* @version $Id: DateUtils.java,v 1.11 2003/08/10 13:32:16 stevencaswell Exp $
*/
public class DateUtils {
@ -418,23 +418,11 @@ private static void modify(Calendar val, int field, boolean round) {
* @throws IllegalArgumentException if the date cannot be parsed
*/
public static Calendar parseCVS(String dateStr) {
return parseCVS(dateStr, Locale.getDefault());
}
/**
* <p>Parses a date string formatted in CVS format.</p>
*
* @param dateStr the date to parse
* @param locale the locale to parse in
* @return the parsed date
* @throws IllegalArgumentException if the date is null or cannot be parsed
*/
public static Calendar parseCVS(String dateStr, Locale locale) {
if (dateStr == null) {
throw new IllegalArgumentException("The date must not be null");
}
//Get the symbol names
DateFormatSymbols symbols = new DateFormatSymbols(locale);
DateFormatSymbols symbols = new DateFormatSymbols(Locale.ENGLISH);
//Prep the string to parse
String value = dateStr.toLowerCase().trim();