Compare commits
2 Commits
e866e94303
...
05d3aaa8dd
| Author | SHA1 | Date | |
|---|---|---|---|
| 05d3aaa8dd | |||
| 9afb3328ba |
52
autoload/assono-backup-nexttape.nu
Normal file
52
autoload/assono-backup-nexttape.nu
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
export def lumen-assono-backup-nexttape [dateinput: datetime]: nothing -> nothing {
|
||||||
|
$dateinput | get-backup-string
|
||||||
|
print 'Next Required Tape:'
|
||||||
|
print $'($dateinput | get-backup-string)'
|
||||||
|
print ''
|
||||||
|
print 'Tapes after that:'
|
||||||
|
|
||||||
|
..9 | each {|i|
|
||||||
|
print $'($i): (($dateinput + ((7 * $i) | into duration -u day)) | get-backup-string)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def get-backup-string []: datetime -> string {
|
||||||
|
print $in
|
||||||
|
let saturdayOfMonth = $in | get-week-of-month 6
|
||||||
|
let monthOfQuarter = $in | get-month-of-quarter
|
||||||
|
let quarter = $in | get-quarter
|
||||||
|
let year = $in | get-year
|
||||||
|
if ($saturdayOfMonth == 1) {
|
||||||
|
if ($monthOfQuarter == 1) {
|
||||||
|
if ($quarter == 1) {
|
||||||
|
$'TapeLTO5-Y($year)'
|
||||||
|
} else {
|
||||||
|
$'TapeLTO5-Q($quarter)'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$'TapeLTO5-M($monthOfQuarter)'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$'TapeLTO5-W($saturdayOfMonth)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def get-week-of-month [weekdayindex: int]: datetime -> int {
|
||||||
|
($in + ($weekdayindex | into duration -u day) - (($in | format date '%w' ) | into duration -u day)) | format date %w
|
||||||
|
}
|
||||||
|
|
||||||
|
def get-month-of-quarter []: datetime -> int {
|
||||||
|
mut month = $in | format date '%m' | into int
|
||||||
|
while ($month > 3) {
|
||||||
|
$month -= 3
|
||||||
|
}
|
||||||
|
$month
|
||||||
|
}
|
||||||
|
|
||||||
|
def get-quarter []: datetime -> int {
|
||||||
|
(($in | format date '%m') | into int) / 3 | math ceil
|
||||||
|
}
|
||||||
|
|
||||||
|
def get-year []: datetime -> int {
|
||||||
|
$in | format date '%Y'
|
||||||
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
export def lumen-assono-overtime-calc [startdate = datetime]: nothing -> string {
|
export def lumen-assono-overtime-calc [startdate: datetime]: nothing -> string {
|
||||||
pwsh -command $'Invoke-assOrgaOvertimeCalculator ($startdate)'
|
pwsh -command $'Invoke-assOrgaOvertimeCalculator ($startdate | format date '%d/%m/%Y')'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export def lumen-assono-worktime-calc [datestr = string]: nothing -> string {
|
export def lumen-assono-worktime-calc [datestr: string]: nothing -> string {
|
||||||
let $datestr = $datestr | str replace ' +' ' '
|
let $datestr = $datestr | str replace ' +' ' '
|
||||||
mut $dateArray = []
|
mut $dateArray = []
|
||||||
let $rawDateArray = $datestr | split row ' '
|
let $rawDateArray = $datestr | split row ' '
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export def lumen-kwin-get-class [waittimesec = int]: nothing -> string {
|
export def lumen-kwin-get-class [waittimesec: int]: nothing -> string {
|
||||||
mut timer = ($waittimesec | into int)
|
mut timer = $waittimesec
|
||||||
while ($timer > 0) {
|
while ($timer > 0) {
|
||||||
$timer | print
|
$timer | print
|
||||||
$timer -= 1
|
$timer -= 1
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export def lumen-search-content [searchstr = string]: any -> table {
|
export def lumen-search-content [searchstr: string]: any -> table {
|
||||||
let $tmp = $in
|
let $tmp = $in
|
||||||
mut $path = pwd
|
mut $path = pwd
|
||||||
if ($tmp != null) {
|
if ($tmp != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user