1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

rename date format to format date (#571)

This commit is contained in:
Antoine Stevan 2023-08-04 16:08:10 +02:00 committed by GitHub
parent 1d8457fa9d
commit be47e43db6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 37 additions and 37 deletions

View file

@ -73,7 +73,7 @@ def get_weather_by_ip [locIdx: int, units: string, token: string] {
let forecast = ($forecast_data.list | each {|day|
{
id: ($day.weather.0.id)
dt: ($day.dt | into string | into datetime -z local | date format '%a, %b %e') #'%Y-%m-%d')
dt: ($day.dt | into string | into datetime -z local | format date '%a, %b %e') #'%Y-%m-%d')
high: ($day.temp.max)
low: ($day.temp.min)
}
@ -111,7 +111,7 @@ def get_weather_by_ip [locIdx: int, units: string, token: string] {
let forecast = ($forecast_data.list | each {|day|
{
id: ($day.weather.0.id)
dt: ($day.dt | into string | into datetime -z local | date format '%a, %b %e') #'%Y-%m-%d')
dt: ($day.dt | into string | into datetime -z local | format date '%a, %b %e') #'%Y-%m-%d')
high: ($day.temp.max)
low: ($day.temp.min)
}

View file

@ -55,7 +55,7 @@ def timed_weather_run [
Source: "expired-cache"
Emoji: ($emoji)
}
$weather_table | upsert last_run_time {(date now | date format '%Y-%m-%d %H:%M:%S %z')} | save $weather_runtime_file
$weather_table | upsert last_run_time {(date now | format date '%Y-%m-%d %H:%M:%S %z')} | save $weather_runtime_file
}
} else {
# $"Unable to find [($weather_runtime_file)], creating it(char nl)"
@ -67,7 +67,7 @@ def timed_weather_run [
Source: "initial"
Emoji: ($emoji)
}
$weather_table | upsert last_run_time {(date now | date format '%Y-%m-%d %H:%M:%S %z')} | save $weather_runtime_file
$weather_table | upsert last_run_time {(date now | format date '%Y-%m-%d %H:%M:%S %z')} | save $weather_runtime_file
}
} else {
echo "Your command did not run because you are not on Windows..."

View file

@ -9,7 +9,7 @@
use get-weather.nu get_weather
# Create a mutable weather table to hold the weather data
$env.WEATHER = (get_weather | upsert last_run_time { (date now | date format '%Y-%m-%d %H:%M:%S %z')})
$env.WEATHER = (get_weather | upsert last_run_time { (date now | format date '%Y-%m-%d %H:%M:%S %z')})
#command to run at interval
def-env timed_weather_run [
@ -30,7 +30,7 @@ def-env timed_weather_run [
} else {
# $"interval met, running command: [($command)](char nl)"
$env.WEATHER = (get_weather | upsert last_run_time { (date now | date format '%Y-%m-%d %H:%M:%S %z')})
$env.WEATHER = (get_weather | upsert last_run_time { (date now | format date '%Y-%m-%d %H:%M:%S %z')})
let temp = ($env.WEATHER.Temperature)
let emoji = ($env.WEATHER.Emoji)
{

View file

@ -132,7 +132,7 @@ export def-env get_weather_by_interval [INTERVAL_WEATHER] {
if ($LAST_WEATHER_TIME | into datetime) + $INTERVAL_WEATHER < (date now) {
let WEATHER = (get_weather_for_prompt (get_location 0))
let NEW_WEATHER_TIME = (date now | date format '%Y-%m-%d %H:%M:%S %z')
let NEW_WEATHER_TIME = (date now | format date '%Y-%m-%d %H:%M:%S %z')
$last_runtime_data | upsert weather $WEATHER | upsert last_weather_time $NEW_WEATHER_TIME | save $weather_runtime_file
@ -142,7 +142,7 @@ export def-env get_weather_by_interval [INTERVAL_WEATHER] {
}
} else {
let WEATHER = (get_weather_for_prompt (get_location 0))
let LAST_WEATHER_TIME = (date now | date format '%Y-%m-%d %H:%M:%S %z')
let LAST_WEATHER_TIME = (date now | format date '%Y-%m-%d %H:%M:%S %z')
let WEATHER_DATA = {
"weather": ($WEATHER)