Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
pheobeayo committed Aug 30, 2024
1 parent 3df5ca2 commit adc3793
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/endpoints/achievements/verify_seniority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ use axum::{
Json,
};
use axum_auto_routes::route;
use chrono::{TimeZone, Utc, DateTime};
use chrono::Datelike;
use chrono::{Utc, DateTime};
use serde_json::json;
use starknet::core::types::FieldElement;

Expand All @@ -36,8 +35,9 @@ pub async fn handler(
Ok(timestamp) => {

let date_time = DateTime::from_timestamp(timestamp as i64, 0).unwrap();
let duration = date_time ;
let days_passed = duration.num_days_from_ce();
let current_time = Utc::now();
let duration = current_time - date_time;
let days_passed = duration.num_days();
if (achievement_id == 14 && days_passed >= 90)
|| (achievement_id == 15 && days_passed >= 180)
|| (achievement_id == 16 && days_passed >= 365)
Expand Down

0 comments on commit adc3793

Please sign in to comment.