hledger-flow: btcpayserver: add local timezone support
This commit is contained in:
@@ -77,13 +77,29 @@ function btcpayserver::legacy()
|
|||||||
if (NR<2 || $1 !~ global_year)
|
if (NR<2 || $1 !~ global_year)
|
||||||
next
|
next
|
||||||
|
|
||||||
printf $1 OFS # ReceivedDate
|
# ReceivedDate (w/ local timezone added)
|
||||||
|
sub(/ /, "T", $1) # HACK: makes arg-friendly by removing space
|
||||||
|
cmd = "date \"+%F %T %z\" --date="$1 | getline date
|
||||||
|
printf date OFS
|
||||||
|
|
||||||
printf $2 OFS # StoreId
|
printf $2 OFS # StoreId
|
||||||
printf $3 OFS # OrderId
|
printf $3 OFS # OrderId
|
||||||
printf $4 OFS # InvoiceId
|
printf $4 OFS # InvoiceId
|
||||||
printf $5 OFS # InvoiceCreatedDate
|
|
||||||
printf $6 OFS # InvoiceExpirationDate
|
# InvoiceCreatedDate (w/ local timezone added)
|
||||||
printf $7 OFS # InvoiceMonitoringDate
|
sub(/ /, "T", $5)
|
||||||
|
cmd = "date \"+%F %T %z\" --date="$5 | getline date
|
||||||
|
printf date OFS
|
||||||
|
|
||||||
|
# InvoiceExpirationDate (w/ local timezone added)
|
||||||
|
sub(/ /, "T", $6)
|
||||||
|
cmd = "date \"+%F %T %z\" --date="$6 | getline date
|
||||||
|
printf date OFS
|
||||||
|
|
||||||
|
# InvoiceMonitoringDate (w/ local timezone added)
|
||||||
|
sub(/ /, "T", $7)
|
||||||
|
cmd = "date \"+%F %T %z\" --date="$7 | getline date
|
||||||
|
printf date OFS
|
||||||
|
|
||||||
# PaymentId
|
# PaymentId
|
||||||
# NOTE: BTCPay Server will append the block index as "-N" to the txid
|
# NOTE: BTCPay Server will append the block index as "-N" to the txid
|
||||||
@@ -160,7 +176,11 @@ function btcpayserver::wallets()
|
|||||||
if ($6 !~ /^-/)
|
if ($6 !~ /^-/)
|
||||||
next
|
next
|
||||||
|
|
||||||
printf $1 OFS # Date (ReceivedDate)
|
# Date (ReceivedDate w/ local timezone added)
|
||||||
|
sub(/ /, "T", $1) # HACK: makes arg-friendly by removing space
|
||||||
|
cmd = "date \"+%F %T %z\" --date="$1 | getline date
|
||||||
|
printf date OFS
|
||||||
|
|
||||||
printf OFS # (StoreId)
|
printf OFS # (StoreId)
|
||||||
printf OFS # (OrderId)
|
printf OFS # (OrderId)
|
||||||
printf $4 OFS # InvoiceId (InvoiceId)
|
printf $4 OFS # InvoiceId (InvoiceId)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
fields ReceivedDate,StoreId,OrderId,InvoiceId,InvoiceCreatedDate,InvoiceExpirationDate,InvoiceMonitoringDate,txid,index,Destination,PaymentType,CryptoCode,Paid,NetworkFee,ConversionRate,PaidCurrency,InvoiceCurrency,InvoiceDue,InvoicePrice,InvoiceItemCode,InvoiceItemDesc,InvoiceFullStatus,InvoiceStatus,InvoiceExceptionStatus,BuyerEmail,Accounted,direction,subaccount
|
fields ReceivedDate,StoreId,OrderId,InvoiceId,InvoiceCreatedDate,InvoiceExpirationDate,InvoiceMonitoringDate,txid,index,Destination,PaymentType,CryptoCode,Paid,NetworkFee,ConversionRate,PaidCurrency,InvoiceCurrency,InvoiceDue,InvoicePrice,InvoiceItemCode,InvoiceItemDesc,InvoiceFullStatus,InvoiceStatus,InvoiceExceptionStatus,BuyerEmail,Accounted,direction,subaccount
|
||||||
|
|
||||||
# NOTE: BTCPayServer exports to localtime
|
# NOTE: BTCPayServer exports to localtime
|
||||||
date-format %Y-%m-%d %H:%M:%S
|
date-format %Y-%m-%d %H:%M:%S %z
|
||||||
date %ReceivedDate
|
date %ReceivedDate
|
||||||
|
|
||||||
description %ReceivedDate
|
description %ReceivedDate
|
||||||
|
|||||||
Reference in New Issue
Block a user