Comment by hypertexthero

Comment by hypertexthero 2 months ago

4 replies

Anyone know how to change the default :date output to YYYY-MM-DD instead of MM/DD/YYYY on macOS?

I’ve tried the following in default.yml and reloading the config, but it’s not working and Claude, Gemini, and myself are stumped :)

  matches:  
    - trigger: ":date"  
      replace: "{{mydate}}"  
      vars:  
        - name: mydate  
          type: date  
          params:  
            format: "%Y-%m-%d"
hypertexthero 2 months ago

Solution: Edit the # Print the current date section in…

  /Users/$USER/Library/Application Support/espanso/match/base.yml
…to read:

  # Print the current date
  - trigger: ":date"
    replace: "{{mydate}}"
    vars:
      - name: mydate
        type: date
        params:
          format: "%Y-%m-%d"
kemitchell 2 months ago

I shell out to POSIX `date` on Linux and I believe also on Windows:

    - trigger: ";tod"
      replace: "{{mydate}}"
      vars:
      - name: mydate
        type: shell
        params:
          cmd: date --iso-8601
dorian-graph 2 months ago

I know it's not perhaps helpful, but I have the _exact_ same code, and it's worked for ages on macOS. Do other matches work correctly?

I have it in `~/.config/espanso/match/base.yml`.