%%
%% This is file `annee-scolaire.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% annee-scolaire.dtx  (with options: `package')
%% 
%% Do not distribute this file without also distributing the
%% source files specified above.
%% 
%% Do not distribute a modified version of this file.
%% 
%% File: annee-scolaire.dtx
%% Copyright (C) 2020 Yvon Henel aka Le TeXnicien de surface
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%%
%%    http://www.latex-project.org/lppl.txt
%%
\RequirePackage{expl3}[2013/03/12]
\GetIdInfo$Id: annee-scolaire.dtx 1.5 2020-04-05 TdS $
  {}
\ProvidesExplPackage
  {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\RequirePackage{xparse}
\RequirePackage{l3keys2e}
\keys_define:nn {annee-scolaire}
{
  premiermois .int_set:N = \c__AnneeScolaire_Premier_Mois_int,
  premiermois .initial:n = {8},
  premierjour .int_set:N = \c__AnneeScolaire_Premier_Jour_int,
  premierjour .initial:n = {1},
  decalage .int_set:N = \c__AnneeScolaire_Decalage_int,
  decalage .initial:n = {0},
  separateur  .tl_set:N  = \c__AnneeScolaire_Separe_Annees_tl,
  separateur  .initial:n = {-}
}
\ProcessKeysOptions { annee-scolaire }
\int_const:Nn \c__AnneeScolaire_Annee_Deb_int {
  \int_compare:nNnTF { 100*\the\month + \the\day } <
  { 100*\c__AnneeScolaire_Premier_Mois_int + \c__AnneeScolaire_Premier_Jour_int}
  {\year - \c_one + \c__AnneeScolaire_Decalage_int}
  {\year + \c__AnneeScolaire_Decalage_int}
}
\int_const:Nn \c__AnneeScolaire_Annee_Fin_int {
  \c__AnneeScolaire_Annee_Deb_int + \c_one
}
\NewDocumentCommand \AnneeScolairePresentation { o m }
{
  \int_to_arabic:n { #2 }
}
\NewDocumentCommand \anneescolaire { O{0} }
{
  \AnneeScolairePresentation[1] {\c__AnneeScolaire_Annee_Deb_int + #1}
  \c__AnneeScolaire_Separe_Annees_tl
  \AnneeScolairePresentation[2] {\c__AnneeScolaire_Annee_Fin_int + #1}
}
\NewDocumentCommand \debutanneescolaire { O{0} }
  {
    \AnneeScolairePresentation[3] {\c__AnneeScolaire_Annee_Deb_int + #1}
  }
\NewDocumentCommand \finanneescolaire { O{0} }
  {
    \AnneeScolairePresentation[4] {\c__AnneeScolaire_Annee_Fin_int + #1}
  }
\endinput
%%
%% End of file `annee-scolaire.sty'.
