svendiedrichsen / jollyday

Jollyday - A holiday API
Other
189 stars 114 forks source link

Custom Holidays #63

Closed someshjainamazon closed 6 years ago

someshjainamazon commented 6 years ago

Hi, I am able to load my custom holidays, but it's not able to read the decription as the corresponding keys don't exist in holiday_descriptions.properties. I've provided the key in my custom properties but that doesn't seem to work either

  def getConfig(): HolidayManager = {
    val urlOpt = Some(getClass.getClassLoader.getResource("holidays.xml"))
    urlOpt match {
      case Some(url : URL) =>
        val props = new Properties()
        props.put("holiday.description.OATH_BIRTHDAY", "oath birthday")
        val urlManParam = new UrlManagerParameter(url, props)
        HolidayManager.getInstance(urlManParam)
      case _ =>
        HolidayManager.getInstance()
    }
svendiedrichsen commented 6 years ago

@someshjainiitkgp I'm afraid but there is currently no way to add new descriptions like you can add new holiday files.