npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kamkam1_0/french-dates

v1.2.5

Published

French-Dates est un module simple du'tilisation qui permet d'obtenir différentes dates clés françaises

Downloads

41

Readme

French-Dates

French-Dates est un module simple du'tilisation qui permet d'obtenir différentes dates clés françaises

Installation

npm i @kamkam1_0/french-dates

Methodes disponibles

  • Feries
  • Vacances
  • Validation de dates
  • Numero de semaine avec une date
  • Nom d'un jour avec une date
  • Jour d'une semaine avec le numero de semaine et l'année

Comment l'utiliser

Initialiser le module

const Dates = require("@kamkam1_0/french-dates")

General

Nom d'un jour avec la date

let name = Dates.nomDuJour("09/09/2022")
//Sortie: { etat: true, jour: 'Vendredi' }

Numero de semaine avec la date

let name = Dates.numeroSemaine("09/09/2022")
//Sortie: { nombre: 36, annee: 2022, etat: true }

Jours dans la semaine avec le numero de semaine et l'annee

let name = Dates.joursDeSemaine(36, 2022)
/*Sortie: 
{
    etat: true,
    jours: [
        [ '05/09/2022', 'Lundi' ],
        [ '06/09/2022', 'Mardi' ],
        [ '07/09/2022', 'Mercredi' ],
        [ '08/09/2022', 'Jeudi' ],
        [ '09/09/2022', 'Vendredi' ],
        [ '10/09/2022', 'Samedi' ],
        [ '11/09/2022', 'Dimanche' ]
    ]
}
*/

Feries

let name = Dates.feries("metropole")
/*Sortie: 
{
    etat: true,
    reponse: [
        { nom: '1er janvier', date: '2023-01-01', timestamp: 1672534800000 },
        {
            nom: 'Lundi de Pâques',
            date: '2023-04-10',
            timestamp: 1681084800000
        },
        { nom: '1er mai', date: '2023-05-01', timestamp: 1682899200000 },
        { nom: '8 mai', date: '2023-05-08', timestamp: 1683504000000 },
        { nom: 'Ascension', date: '2023-05-18', timestamp: 1684368000000 },
        {
            nom: 'Lundi de Pentecôte',
            date: '2023-05-29',
            timestamp: 1685318400000
        },
        { nom: '14 juillet', date: '2023-07-14', timestamp: 1689292800000 },
        { nom: 'Assomption', date: '2023-08-15', timestamp: 1692057600000 },
        { nom: 'Toussaint', date: '2023-11-01', timestamp: 1698800400000 },
        { nom: '11 novembre', date: '2023-11-11', timestamp: 1699664400000 },
        { nom: 'Jour de Noël', date: '2023-12-25', timestamp: 1703466000000 }
    ]
}
*/

Vacances

let name = Dates.vacances('C')
/*Sortie: 
{
    etat: true,
    reponse: [
        {
            debut: 1671231600000,
            end: 1672700400000,
            dateDebut: '16/12/2022',
            dateFin: '02/01/2023',
            dureeTexte: '17 days',
            duree: 1468800000,
            zones: ['A']
        },
        {
            debut: 1676674800000,
            end: 1678057200000,
            dateDebut: '17/02/2023',
            dateFin: '05/03/2023',
            dureeTexte: '16 days',
            duree: 1382400000,
            zones: ['A', 'B']
        },
        {
            debut: 1666389600000,
            end: 1667775600000,
            dateDebut: '21/10/2022',
            dateFin: '06/11/2022',
            dureeTexte: '16 days and 1 hour',
            duree: 1386000000,
            zones: ['A', 'B', 'C']
        },
        {
            debut: 1682114400000,
            end: 1683583200000,
            dateDebut: '21/04/2023',
            dateFin: '08/05/2023',
            dureeTexte: '17 days',
            duree: 1468800000,
            zones: ['A', 'B', 'C', 'Corse']
        },
        {
            debut: 1688767200000,
            end: 1693519200000,
            dateDebut: '07/07/2023',
            dateFin: '31/08/2023',
            dureeTexte: '55 days',
            duree: 4752000000,
            zones: ['B']
        },
        {
            debut: 1684360800000,
            end: 1684706400000,
            dateDebut: '17/05/2023',
            dateFin: '21/05/2023',
            dureeTexte: '4 days',
            duree: 345600000,
            zones: ['C']
        },
        {
            debut: 1688767200000,
            end: 1693778400000,
            dateDebut: '07/07/2023',
            dateFin: '03/09/2023',
            dureeTexte: '58 days',
            duree: 5011200000,
            zones: ['Corse']
        }
    ]
}
}*/

Validation d'une date

let name = Dates.validationDate("09/09/2022")//B ou A
//Sortie: { etat: true }

Obtenir un mois et ses informations

const Dates = require("@kamkam1_0/french-dates")
let zones = Dates.zonesDisponiblesFeries

Informations données disponibles

Informations concernant les zones disponibles pour les jours fériés

const Dates = require("@kamkam1_0/french-dates")
let zones = Dates.jourMaximumMois("janvier")
//OU
let zones = Dates.jourMaximumMois(1)
//Sortie: { etat: true, mois: 1, numero: 31, nom: 'Janvier', moisAnglais: "January"}

Informations contenant le numéro du dernier jour de chaque mois

const Dates = require("@kamkam1_0/french-dates")
let mois = Dates.joursMois