Subversion Repository Public Repository

litesoft

Diff Revisions 859 vs 860 for /trunk/Java/core/Anywhere/src/org/litesoft/core/util/TypeConverter.java

Diff revisions: vs.
  @@ -138,11 +138,11 @@
138 138 {
139 139 return (java.sql.Date) pObject;
140 140 }
141 - SimpleDate date = to_SimpleDate( null, pObject );
141 + CalendarYMD date = to_SimpleDate( null, pObject );
142 142 return to_SqlDate( date );
143 143 }
144 144
145 - public static java.sql.Date to_SqlDate( SimpleDate pDate )
145 + public static java.sql.Date to_SqlDate( CalendarYMD pDate )
146 146 {
147 147 return new java.sql.Date( pDate.toUtilDate().getTime() );
148 148 }
  @@ -161,9 +161,9 @@
161 161 {
162 162 return new Date( ((Number) pObject).longValue() );
163 163 }
164 - if ( pObject instanceof SimpleDate )
164 + if ( pObject instanceof CalendarYMD )
165 165 {
166 - return ((SimpleDate) pObject).toUtilDate();
166 + return ((CalendarYMD) pObject).toUtilDate();
167 167 }
168 168 if ( pObject instanceof SimpleTimestamp )
169 169 {
  @@ -344,15 +344,15 @@
344 344 return temporal.copyWithUpdatedResolution( pTimeRes );
345 345 }
346 346
347 - public static SimpleDate to_SimpleDate( DateRes pDateRes, Object pObject )
347 + public static CalendarYMD to_SimpleDate( DateRes pDateRes, Object pObject )
348 348 {
349 349 if ( null == pObject )
350 350 {
351 351 return null;
352 352 }
353 - if ( pObject instanceof SimpleDate )
353 + if ( pObject instanceof CalendarYMD )
354 354 {
355 - return ((SimpleDate) pObject).changeResolution( pDateRes );
355 + return ((CalendarYMD) pObject).changeResolution( pDateRes );
356 356 }
357 357 if ( pObject instanceof Time )
358 358 {
  @@ -360,20 +360,20 @@
360 360 }
361 361 if ( pObject instanceof Date )
362 362 {
363 - return new SimpleDate( pDateRes, (Date) pObject );
363 + return new CalendarYMD( pDateRes, (Date) pObject );
364 364 }
365 365 if ( pObject instanceof Number )
366 366 {
367 - return new SimpleDate( pDateRes, new Date( ((Number) pObject).longValue() ) );
367 + return new CalendarYMD( pDateRes, new Date( ((Number) pObject).longValue() ) );
368 368 }
369 369 if ( pObject instanceof SimpleTimestamp )
370 370 {
371 - return new SimpleDate( pDateRes, (SimpleTimestamp) pObject );
371 + return new CalendarYMD( pDateRes, (SimpleTimestamp) pObject );
372 372 }
373 373 String s = pObject.toString();
374 374 try
375 375 {
376 - return new SimpleDate( pDateRes, new Date( Long.parseLong( s ) ) );
376 + return new CalendarYMD( pDateRes, new Date( Long.parseLong( s ) ) );
377 377 }
378 378 catch ( NumberFormatException e )
379 379 {
  @@ -381,7 +381,7 @@
381 381 }
382 382 try
383 383 {
384 - return new SimpleDate( pDateRes, UtilDateAdaptor.fromUtilDateToString( s ) );
384 + return new CalendarYMD( pDateRes, UtilDateAdaptor.fromUtilDateToString( s ) );
385 385 }
386 386 catch ( IllegalArgumentException e )
387 387 {
  @@ -389,7 +389,7 @@
389 389 }
390 390 try
391 391 {
392 - return new SimpleDate( pDateRes, java.sql.Date.valueOf( s ) );
392 + return new CalendarYMD( pDateRes, java.sql.Date.valueOf( s ) );
393 393 }
394 394 catch ( IllegalArgumentException e )
395 395 {
  @@ -397,7 +397,7 @@
397 397 }
398 398 try
399 399 {
400 - return SimpleDate.fromYMD( s ).changeResolution( pDateRes );
400 + return CalendarYMD.fromYMD( s ).changeResolution( pDateRes );
401 401 }
402 402 catch ( IllegalArgumentException e )
403 403 {
  @@ -405,7 +405,7 @@
405 405 }
406 406 try
407 407 {
408 - return new SimpleDate( pDateRes, SimpleTimestamp.fromString( s ) );
408 + return new CalendarYMD( pDateRes, SimpleTimestamp.fromString( s ) );
409 409 }
410 410 catch ( IllegalArgumentException e )
411 411 {