Day counter coding help

Hey, I am new to this community and i found project which i really wanted to do.
Its a daycounter. I found out that project but code doesnt work. I search all over the google and tried to fix problem on my own with my very basic coding knowledge but i was unsuccesful and i am desperate.Can someone help me find why it doesnt work?

#include <RTClib.h>
#include <SevSeg.h>


SevSeg sevseg; //Instantiate a seven segment controller object
RTC_DS3231 rtc; 

DateTime dtBegin (2021, 10, 10, 0, 0, 0); //!!!! adjust time here!!!!!
TimeSpan tsPassed;

void showInfo(const DateTime& dt) {
  Serial.print("NOW:");
  
  Serial.print(dt.year(), DEC);
  Serial.print('/');
  Serial.print(dt.month(), DEC);
  Serial.print('/');
  Serial.print(dt.day(), DEC);
  Serial.print(' ');
  Serial.print(dt.hour(), DEC);
  Serial.print(':');
  Serial.print(dt.minute(), DEC);
  Serial.print(':');
  Serial.print(dt.second(), DEC);
  
  Serial.print("\tPASSED:");
  Serial.print(tsPassed.days(), DEC);
  Serial.print(' ');
  Serial.print(tsPassed.hours(), DEC);
  Serial.print(':');
  Serial.print(tsPassed.minutes(), DEC);
  Serial.print(':');
  Serial.print(tsPassed.seconds(), DEC);
  
  Serial.println("");
}

//=========================================
//
//=========================================
void delayWithUpdate(uint32_t parDelay){
  uint32_t started=millis();
  while (millis()< started+parDelay){
    sevseg.refreshDisplay();
  }
}
//=========================
//=========================
void setup(){
  Serial.begin(9600);
  Serial.println(__TIME__);
  
  if (! rtc.begin()) {
        Serial.println("Couldn't find RTC");
        //===Device will be frozen here.
        //?????????May be some error LED blinking would be good to use??????
        while (1);
  }
      
  delay(1000);    
  
  //!!!!! TO ADJUST A TIME:
  //1) uncomment a line below (under those comments)
  //2), upload the code again
  //3) COMMENT line back
  //4). uploand ONE MORE TIME

  
  
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));   //line to adjust time 
      

  byte numDigits = 4;
  byte digitPins[] = {7, 8, 9, 10};
  //SEG:  A B C D E F G .
  //PIN:  11  7 4 2 1 10  5 3
  //ARDU: 2 3 4 5 11  12  13  6
  //byte segmentPins[] = {2, 3, 4, 5, 11, 12, 13, 6};
  byte segmentPins[] = {2, 3, 4, 5, 11, 12, 13, 6};
  bool resistorsOnSegments = false; // 'false' means resistors are on digit pins
  byte hardwareConfig = COMMON_CATHODE; // See README.md for options
  bool updateWithDelays = false; // Default 'false' is Recommended
  bool leadingZeros = false; // Use 'true' if you'd like to keep the leading zeros
  bool disableDecPoint = true; // Use 'true' if your decimal point doesn't exist or isn't connected
  
  sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments,
  updateWithDelays, leadingZeros, disableDecPoint);
  sevseg.setBrightness(100);
  
  
  
  sevseg.setNumber(1234, 1);
  delayWithUpdate(1000);
  
  
  sevseg.setNumber(8888, 1);
  delayWithUpdate(1000);
  
}
//=========================
//=========================
void loop(){
  sevseg.refreshDisplay();
  
  DateTime now = rtc.now();
  
  tsPassed = now-dtBegin;
  
  static uint32_t nextReportMillis=0;
  static uint16_t prevDaysPassed=0;
  
  if (tsPassed.days() != prevDaysPassed){
    prevDaysPassed=tsPassed.days();
    sevseg.setNumber(prevDaysPassed, 0);
  }

  
  sevseg.refreshDisplay();
  
  if (millis()>nextReportMillis){
    //===PRINT SOME INFO HERE
    showInfo(now);
    nextReportMillis=millis()+5000;
  }
  
}

I used

DS3231
Arduino UNO R3
and 7 segment 4 digits LED Display with 12 pins.
(And wires and resistors ofc.)

ATM. Display shows only first 3 digits which is 888- last digit doesnt show up.

Source

Instead of timespan, you could use:

static days_passed = 0;
static last_day = 0;
if (rtc.now().day() != last_day)
{
  if (last_day != 0) days_passed++;
  last_day = rtc.now().day();
}

I found it!

I changed from byte hardwareConfig = COMMON_CATHODE;
to
byte hardwareConfig = COMMON_ANODE;