Subversion Repository Public Repository

litesoft

Diff Revisions 862 vs 863 for /trunk/Java/core/Server/src/org/litesoft/orsup/DB_ImportSupport.java

Diff revisions: vs.
  @@ -447,20 +447,6 @@
447 447 }
448 448 }
449 449
450 - private String makeDeltaDateRelative( String pValue )
451 - {
452 - int zAt = pValue.indexOf( DELTA_DATE_SEP );
453 - if ( zAt == -1 )
454 - {
455 - throw new IllegalArgumentException( "No Delta Date Sep '" + DELTA_DATE_SEP + "'" );
456 - }
457 - CalendarYMD zDesiredDate = to_SimpleDate( "Desired Date", pValue.substring( 0, zAt ) );
458 - CalendarYMD zDeltaDate = to_SimpleDate( "Delta Date", pValue.substring( zAt + DELTA_DATE_SEP.length() ) );
459 - CalendarYMD zToday = CalendarYMD.today();
460 - zDesiredDate = zDesiredDate.addDays( zDeltaDate.daysTill( zToday ) );
461 - return zDesiredDate.toString();
462 - }
463 -
464 450 private String makeTodayRelative( String pValue )
465 451 {
466 452 boolean zAdd;
  @@ -515,14 +501,28 @@
515 501 zDesiredDate = zDesiredDate.minusDays( iDays );
516 502 }
517 503
504 + return zDesiredDate.toSQLvalue();
505 + }
506 +
507 + private String makeDeltaDateRelative( String pValue )
508 + {
509 + int zAt = pValue.indexOf( DELTA_DATE_SEP );
510 + if ( zAt == -1 )
511 + {
512 + throw new IllegalArgumentException( "No Delta Date Sep '" + DELTA_DATE_SEP + "'" );
513 + }
514 + CalendarYMD zDesiredDate = to_CalendarYMD( "Desired Date", pValue.substring( 0, zAt ) );
515 + CalendarYMD zDeltaDate = to_CalendarYMD( "Delta Date", pValue.substring( zAt + DELTA_DATE_SEP.length() ) );
516 + CalendarYMD zToday = CalendarYMD.today();
517 + zDesiredDate = zDesiredDate.addDays( zDeltaDate.daysTill( zToday ) );
518 518 return zDesiredDate.toString();
519 519 }
520 520
521 - private CalendarYMD to_SimpleDate( String pWhat, String pString )
521 + private CalendarYMD to_CalendarYMD( String pWhat, String pString )
522 522 {
523 523 try
524 524 {
525 - return TypeConverter.to_SimpleDate( DateRes.ToYEAR, pString.trim() );
525 + return TypeConverter.to_CalendarYMD( pString.trim() );
526 526 }
527 527 catch ( RuntimeException e )
528 528 {