Subversion Repository Public Repository

litesoft

Diff Revisions 850 vs 851 for /trunk/Java/core/Anywhere/src/org/litesoft/core/simpletypes/temporal/SimpleTimestamp.java

Diff revisions: vs.
  @@ -5,6 +5,7 @@
5 5
6 6 import org.litesoft.core.*;
7 7 import org.litesoft.core.simpletypes.temporal.nonpublic.*;
8 + import org.litesoft.core.typeutils.gregorian.*;
8 9
9 10 /**
10 11 * A Simple Timestamp that acts as a proxy for a java.util.Date (burying the depricated method use) and variable
  @@ -166,7 +167,8 @@
166 167
167 168 public SimpleDate getDateComponents()
168 169 {
169 - return new SimpleDate( "yyyy-MM-dd", mYear, mMonth, mDay );
170 + return new SimpleDate( null, // TODO: XXX "yyyy-MM-dd",
171 + mYear, mMonth, mDay );
170 172 }
171 173
172 174 public SimpleTime getTimeComponents()
  @@ -244,7 +246,7 @@
244 246
245 247 public Date getDate()
246 248 {
247 - return getUtilDateAdaptor().getDate();
249 + return getUtilDateAdaptor().getWallDate();
248 250 }
249 251
250 252 public void setDate( Date pDate )
  @@ -262,7 +264,7 @@
262 264 {
263 265 throw new IllegalArgumentException( "Date was null" );
264 266 }
265 - setDateToResolution( pDate.getUtilDateAdaptor() );
267 + setDateToResolution( pDate.toUtilDateAdaptor() );
266 268 }
267 269
268 270 public void setTimestamp( SimpleTimestamp pTimestamp )
  @@ -376,7 +378,7 @@
376 378 protected void validate( int pYear, int pMonth, int pDay )
377 379 throws IllegalArgumentException
378 380 {
379 - String error = validDate( pYear, pMonth, pDay );
381 + String error = Dates.checkValidity( pYear, pMonth, pDay );
380 382 if ( error != null )
381 383 {
382 384 throw new IllegalArgumentException( error );
  @@ -495,7 +497,7 @@
495 497 pThem.LLtill( this );
496 498 }
497 499
498 - public void add( SimpleTimespan pAdjustBy )
500 + public SimpleTimestamp add( SimpleTimespan pAdjustBy )
499 501 throws IllegalArgumentException
500 502 {
501 503 SimpleTime time = getTimeComponents();
  @@ -503,9 +505,10 @@
503 505 SimpleDate date = getDateComponents();
504 506 date.addDays( adjustByDays );
505 507 setTimestamp( new SimpleTimestamp( date, time ) );
508 + return this; // TODO: XXX
506 509 }
507 510
508 - public void subtract( SimpleTimespan pAdjustBy )
511 + public SimpleTimestamp subtract( SimpleTimespan pAdjustBy )
509 512 throws IllegalArgumentException
510 513 {
511 514 SimpleTime time = getTimeComponents();
  @@ -513,6 +516,7 @@
513 516 SimpleDate date = getDateComponents();
514 517 date.addDays( adjustByDays );
515 518 setTimestamp( new SimpleTimestamp( date, time ) );
519 + return this; // TODO: XXX
516 520 }
517 521
518 522 @Override
  @@ -616,13 +620,13 @@
616 620 {
617 621 mToStringChunks = new Chunk[] //
618 622 { //
619 - new y_Chunk( this ), //
623 + y_Chunk, //
620 624 DASH, //
621 - new MM_Chunk( this ), //
625 + MM_Chunk, //
622 626 DASH, //
623 - new dd_Chunk( this ), //
627 + dd_Chunk, //
624 628 SPACE, //
625 - mTime, //
629 + // TODO: XXX mTime, //
626 630 };
627 631 }
628 632 return mToStringChunks;