all repos

clerk @ d3fcad3049dc9b55eb775f22fdfb98d83101cd26

missing tooling for ledger/hledger
2 files changed, 5 insertions(+), 4 deletions(-)
printer: support 02/12 date format
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2026-09-10 13:36:53 +0300
Authored at: 2026-09-10 13:34:30 +0300
Change ID: olspruxxxlrzyrmyqspvlouszotuvusv
Parent: f2dd916
M journal/printer/testdata/entries.txtar
···
        122
        122
           Expenses:Dining  20.00$

      
        123
        123
           Assets:Cash  -50.00$

      
        124
        124
         

      
        125
        
        -0000-01-01 test

      
        
        125
        +01-01 test

      
        126
        126
           a  123.00$

      
        127
        127
           b

      
        128
        128
         

      
M journal/printer/transaction.go
···
        125
        125
         }

      
        126
        126
         

      
        127
        127
         // writeDate writes date duh.

      
        128
        
        -// TODO: support dates like '02/12'

      
        129
        128
         func (p *printer) writeDate(d ast.Date) {

      
        130
        
        -	p.writeInt(d.Year, 4)

      
        131
        
        -	p.buf.WriteByte('-')

      
        
        129
        +	if d.Year != 0 {

      
        
        130
        +		p.writeInt(d.Year, 4)

      
        
        131
        +		p.buf.WriteByte('-')

      
        
        132
        +	}

      
        132
        133
         	p.writeInt(int(d.Month), 2)

      
        133
        134
         	p.buf.WriteByte('-')

      
        134
        135
         	p.writeInt(int(d.Day), 2)