Code Monkey home page Code Monkey logo

feiertagejs's People

Contributors

dependabot[bot] avatar jeyemwey avatar mschutt avatar sfakir avatar stefpb avatar steveoswald avatar thetric avatar thomaskoscheck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

feiertagejs's Issues

"Weltfrauentag" regions wrong

Hey there,

thanks again for adding the regions array. It seems like there has been added a little bug for "WELTFRAUENTAG". This holiday is only for Berlin and Mecklemburg-Vorpommern, but regions are returning "ALL"

{ "name": "WELTFRAUENTAG", "date": "2024-03-07T23:00:00.000Z", "dateString": "2024-03-08", "regions": [ "BW", "BY", "BE", "BB", "HB", "HE", "HH", "MV", "NI", "NW", "RP", "SL", "SN", "ST", "SH", "TH", "BUND", "ALL" ] }

I guess there happened to be a mistake in line 403 and 407 within your feiertage.ts file: feiertageObjects.push(newHoliday('WELTFRAUENTAG', makeDate(year, 3, 8), ['ALL']));

There could be also more holidays affected. F.e. "WELTKINDERTAG".

For "REFORMATIONSTAG" the validRegions List includes NI twice:

const validRegions: Region[] = [ 'NI', 'BB', 'MV', 'SN', 'ST', 'TH', 'HB', 'HH', 'NI', 'SH', ];

Buß- und Bettag dosent match

Every date matches, but the Buß- und Bettag is wrong...

date:Wed Oct 04 2017 00:00:00 GMT+0200 (CEST) name:"BUBETAG"

tried it with different years but it is always wrong.
(Buß- und Bettag is only in Saxony!)

year as string

From the examples:
var holidays2018 = feiertagejs.getHolidays('2018', 'BUND');
try this for 2017:
var holidays2017 = feiertagejs.getHolidays('2017', 'BUND');
and get missing REFORMATIONSTAG.

Solution:
Write year as number:
var holidays2017 = feiertagejs.getHolidays(2017, 'BUND');
or better change code:
if (year === 2017 || ...
to:
if (year == 2017 || ...

Add Weltfrauentag in Berlin as Holiday

Hey,
first of all thank you, for that incredibly useful library. It is a pleasure to us it.
I would like to ask you to add another holiday to the library. It is Weltfrauentag, on 8th of March and it is a holiday that is only in Berlin. It it will be holiday for the first time this year. Thank you.

Type property "regions" missing for type Holiday

Hey,

I just want to remark that the property "regions" seems to be missing for the type Holiday.

In my case i noticed it when using const holiday = getHolidaysByDate(date,region) that the property "regions" is missing.

getHolidays() and getHolidayByDate() should return region array

It would be handy, if getHolidays() and getHolidayByDate() could return an array with regions if someone calls those functions with region ALL.

The type Holiday could be extended like so:

name: HolidayType
date: date
trans: func
dateString: string
equals: func
regions: array

It can be important to know, in with region this date is a holiday without calling isHoliday(date, region) for all regions.

Forgot HH

You forgot to add HH to your validRegions-Array

isSpecificHoliday

Works isSpecificHoliday with any date?
isSpecificHoliday(new Date('2021-12-25T09:30:00.000+01:00'), 'CHRISTIHIMMELFAHRT', 'ALL')

returns true. I was expecting it returns false.

Get holiday name of a specific date

There already exists getHolidays that returns an array with all holidays of a year. Can you please add a method to get the holiday name of one date?

Maria Himmelfahrt in Bayern

Hi,

bei der Funktion für Maria Himmelfahrt steht region == 'SL' || region == 'ALL'.
Da das nur in Bayern und Saarland ein Feiertag ist müsste wohl statt ALL ein BY hin.

make isHoliday immutable

Hey,

I came across a bug where isHoliday caused an error. It actually changed my time, so I had to pass a copy of my dateObject.

The reason probably is here:

function toUtcTimestamp(date: Date): number {
  date.setHours(0, 0, 0, 0);
  return date.getTime();
}

Maybe you shouldnt use setHours on the passed date but return a new Date():

function toUtcTimestamp(date: Date): number {
  let tmpDate = new Date(date);
  tmpDate.setHours(0,0,0,0);
  return tmpDate.getTime();
}

Kind Regards

Please publish a new version

Seems like lots of things have happened and the api changed. Also typescript definitions were added. Would be great to have those things published :) 🚀

Compatibility between feiertagejs and DateJs

When using DateJs together with feiertagejs, some of the DateJs functions seem to stop working. For example:

Date.today().add(1).day(); // -> undefined when using with feiertagejs

Is there a way to use both libraries together? Thanks.

Feiertage.JS - Feiertage in bavaria wrong

hello,
in Version 0.1.1 there were some false postives, due to the internal representation of the date.
The new version 0.1.2 moved to UTC timestamps, which passes now all the tests.

Please check if you have the latest version!!

Attempted import error

on react/next.js with typescript I run into this error on version 1.3.6:

Attempted import error: 'isHoliday' is not exported from 'feiertagejs' (imported as 'isHoliday').

when importing like this:

import { isHoliday } from "feiertagejs";

isHoliday is then undefined.

a rollback to 1.3.5 solved the issue for me

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.