Liking cljdoc? Tell your friends :D

clj-jollyday


CreateManagercljprotocol

create-managerclj

(create-manager input)
source

holidayclj

(holiday hm year properties-key-or-descr)
sourceraw docstring

holiday?clj

(holiday? hm d)

Takes an HolidayManager and a date object and returns true if date is an holiday, false otherwise.

Takes an HolidayManager and a date object and returns true
if date is an holiday, false otherwise.
sourceraw docstring

holidaysclj

(holidays hm year)
(holidays hm date-from date-to)
source

managerclj

(manager)
(manager input)

Given a country calendar (e.g. :italy) as an argument returns an HolidayManager that can be utilized to compute holidays for that country.

Given a country calendar (e.g. :italy) as an argument returns an HolidayManager
that can be utilized to compute holidays for that country.
sourceraw docstring

parse-ednclj

(parse-edn m)

Parse an edn map given as input and returns a xml structure.

The edn is expected to contains a configuration key and an holidays key mapped to an array of holidays.

;> (parse-edn {:configuration {:hierarchy "IT"} :holidays [[:FixedWeekday {:weekday "SATURDAY" :which "FIRST" :month "NOVEMBER" :descriptionPropertiesKey "MY_CUSTOM_1"}] [:FixedWeekday {:weekday "SUNDAY" :which "FIRST" :month "NOVEMBER" :descriptionPropertiesKey "MY_CUSTOM_2"}]]}) => {:tag :configuration, :attrs {:hierarchy "IT", :xmlns:tns "http://www.example.org/Holiday"}, :xmlns:xsi "http://www.w3.org/2001/XMLSchema-instance", :xsi:schemaLocation "http://www.example.org/Holiday /Holiday.xsd" :content ({:tag :tns:Holidays, :attrs {}, :content ({:tag :FixedWeekday, :attrs {:weekday "SATURDAY", :which "FIRST", :month "NOVEMBER", :descriptionPropertiesKey "MY_CUSTOM_1"}, :content ()} {:tag :FixedWeekday, :attrs {:weekday "SUNDAY", :which "FIRST", :month "NOVEMBER", :descriptionPropertiesKey "MY_CUSTOM_2"}, :content ()})})}

Parse an edn map given as input and returns a xml
structure.

The edn is expected to contains a configuration key and
an holidays key mapped to an array of holidays.

;> (parse-edn
    {:configuration {:hierarchy "IT"}
     :holidays      [[:FixedWeekday {:weekday                  "SATURDAY"
                                     :which                    "FIRST"
                                     :month                    "NOVEMBER"
                                     :descriptionPropertiesKey "MY_CUSTOM_1"}]
                     [:FixedWeekday {:weekday                  "SUNDAY"
                                     :which                    "FIRST"
                                     :month                    "NOVEMBER"
                                     :descriptionPropertiesKey "MY_CUSTOM_2"}]]})
=> {:tag :configuration,
:attrs
{:hierarchy "IT", :xmlns:tns "http://www.example.org/Holiday"},
 :xmlns:xsi "http://www.w3.org/2001/XMLSchema-instance",
 :xsi:schemaLocation "http://www.example.org/Holiday /Holiday.xsd"
:content
({:tag   :tns:Holidays,
  :attrs {},
  :content
  ({:tag     :FixedWeekday,
    :attrs
    {:weekday                  "SATURDAY",
     :which                    "FIRST",
     :month                    "NOVEMBER",
     :descriptionPropertiesKey "MY_CUSTOM_1"},
    :content ()}
   {:tag     :FixedWeekday,
    :attrs
    {:weekday                  "SUNDAY",
     :which                    "FIRST",
     :month                    "NOVEMBER",
     :descriptionPropertiesKey "MY_CUSTOM_2"},
    :content ()})})}
sourceraw docstring

parse-xmlclj

(parse-xml xml)

Parse an xml string given as input and returns an edn structure that can be manipulated as appropriate and eventually turned back to xml format again.

Parse an xml string given as input and returns an edn
structure that can be manipulated as appropriate and
eventually turned back to xml format again.
sourceraw docstring

predefined-calendarsclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close