Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @param other
- * zweite Zeit
- * @return true/ false, ob danach
- */
- public boolean isAfter(DateTimeBi other) {
- return (milliseconds >= other.milliseconds);
- }
- /**
- *
- * @param other
- * zweite Zeit
- * @return true/ false, ob davor
- */
- public boolean isBefore(DateTimeBi other) {
- return (milliseconds <= other.milliseconds);
- }
- /**
- * wie oben, nur wird jetzt lediglich noch auf den Tag/ Stunden/ etc. geschaut
- *
- * @param other
- * anderes Datum
- * @param ignoreWeek
- * woche soll außen vor gelassen werden
- * @return true/ false
- */
- public boolean isAfter(DateTimeBi other, boolean ignoreWeek) {
- long millinew = milliseconds;
- long othermilli = other.milliseconds;
- if (ignoreWeek) {
- millinew -= getYear() * YEARMILLI + getMonth() * MONTHMILLI + getWeeks() * WEEKMILLI;
- othermilli -= other.getYear() * YEARMILLI + other.getMonth() * MONTHMILLI + other.getWeeks() * WEEKMILLI;
- }
- return (millinew >= othermilli);
- }
- /**
- * wie oben, nur wird jetzt lediglich noch auf den Tag/ Stunden/ etc. geschaut
- *
- * @param other
- * anderes Datum
- * @param ignoreWeek
- * woche soll außen vor gelassen werden
- * @return true/ false
- */
- public boolean isBefore(DateTimeBi other, boolean ignoreWeek) {
- long millinew = milliseconds;
- long othermilli = other.milliseconds;
- if (ignoreWeek) {
- millinew -= getYear() * YEARMILLI + getMonth() * MONTHMILLI + getWeeks() * WEEKMILLI;
- othermilli -= other.getYear() * YEARMILLI + other.getMonth() * MONTHMILLI + other.getWeeks() * WEEKMILLI;
- }
- // if (milliseconds < other.milliseconds) {
- // return true;
- // }else if(milliseconds == other.milliseconds){
- // return true;
- // }else {
- // return false;
- // }
- return (millinew <= othermilli);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement