pub fn previous_date(self) -> DateTuple {
        if self.y == 0 && self.m == 1 && self.d == 1 {
            return self;
        }
        if self.d == 1 {
            if self.m == 1 {
                DateTuple {
                    y: self.y - 1,
                    m: 12,
                    d: date_utils::get_last_date_in_month(12, self.y - 1),
                }
            } else {
                DateTuple {
                    y: self.y,
                    m: self.m - 1,
                    d: date_utils::get_last_date_in_month(self.m - 1, self.y),
                }
            }
        } else {
            DateTuple {
                y: self.y,
                m: self.m,
                d: self.d - 1,
            }
        }
    }
/// Gets a DateTuple representing the date immediately preceding
/// the current one. Will not go past 1 Jan 0000.
Gets a DateTuple representing the date immediately preceding
the current one. Will not go past 1 Jan 0000.
Gets a DateTuple representing the date immediately preceding the current one . Will not go past 1 Jan 0000 .
pub fn previous_date(self) -> DateTuple {
        if self.y == 0 && self.m == 1 && self.d == 1 {
            return self;
        }
        if self.d == 1 {
            if self.m == 1 {
                DateTuple {
                    y: self.y - 1,
                    m: 12,
                    d: date_utils::get_last_date_in_month(12, self.y - 1),
                }
            } else {
                DateTuple {
                    y: self.y,
                    m: self.m - 1,
                    d: date_utils::get_last_date_in_month(self.m - 1, self.y),
                }
            }
        } else {
            DateTuple {
                y: self.y,
                m: self.m,
                d: self.d - 1,
            }
        }
    }
pub fn previous_date ( self ) -> DateTuple { if self . y == 0 && self . m == 1 && self . d == 1 { return self ; } if self . d == 1 { if self . m == 1 { DateTuple { y : self . y - 1 , m : 12 , d : date_utils :: get_last_date_in_month ( 12 , self . y - 1 ) , } } else { DateTuple { y : self . y , m : self . m - 1 , d : date_utils :: get_last_date_in_month ( self . m - 1 , self . y ) , } } } else { DateTuple { y : self . y , m : self . m , d : self . d - 1 , } } }
Gets a DateTuple representing the date immediately preceding
the current one.
Gets a DateTuple representing the date immediately preceding the current one .
self
self