Skip to content

Commit 8233ecd

Browse files
committed
Format date in coingecko request url as required DD-MM-YYYY
1 parent 8671834 commit 8233ecd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coin_gecko.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pub async fn get_historical_price(
177177

178178
let (maybe_pro, x_cg_pro_api_key) = get_cg_pro_api_key();
179179
let url = format!(
180-
"https://{maybe_pro}api.coingecko.com/api/v3/coins/{}/history?date={}-{}-{}&localization=false{x_cg_pro_api_key}",
180+
"https://{maybe_pro}api.coingecko.com/api/v3/coins/{}/history?date={:02}-{:02}-{:4}&localization=false{x_cg_pro_api_key}",
181181
coin,
182182
when.day(),
183183
when.month(),

0 commit comments

Comments
 (0)