DaniSchenk / moment-feiertage

MomentJS Plugin: Check if a date is a german holiday (Feiertag)
https://www.npmjs.com/package/moment-feiertage
30 stars 11 forks source link

React native support #7

Closed uncledent closed 5 years ago

uncledent commented 5 years ago

On react-native isHoliday() is always undefined. Any idea how to add RN support?

DaniSchenk commented 5 years ago

Hey @uncledent, I could not reproduce your issue. With using a fresh installation everything worked as expected. My steps:

npm install -g expo-cli
expo init AwesomeProject
cd AwesomeProject
npm install moment moment-feiertage --save
npm start

bevore starting I added these lines in App.js:

import moment from 'moment';
import 'moment-feiertage';

export default class App extends React.Component {
  constructor(props) {
    super(props);
    console.log(moment().isHoliday([]));
  }

  render() { ...

I'm not familiar with react-native, so maybe I'm missing something. The isHoliday() function returned the correct object anyway. Let me know if you could solve your error. Cheers!

DaniSchenk commented 5 years ago

@uncledent I'm closing this issue due inactivity. Fell free to reopen it, if there's any news or questions...