Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Created February 11, 2025 16:31
Show Gist options
  • Save ThomasG77/ccfb94b3823896bd2ccec5ec1ba863da to your computer and use it in GitHub Desktop.
Save ThomasG77/ccfb94b3823896bd2ccec5ec1ba863da to your computer and use it in GitHub Desktop.
API jours fériés: passage sous forme de tableau

API jours fériés: passage sous forme de tableau

curl -s https://calendrier.api.gouv.fr/jours-feries/metropole.json | jq '[. | to_entries|sort_by(.key)| .[] | {"date":.key, "event": .value}]'
fetch('https://calendrier.api.gouv.fr/jours-feries/metropole.json').then(res => res.json()).then(json => {
    console.log(Object.entries(abc).map(([k,v]) => ({"date":k, "event": v})).toSorted((a, b) => a.date - b.date))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment