How to use the @ui-kitten/components.NativeDateService function in @ui-kitten/components

To help you get started, we’ve selected a few @ui-kitten/components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github akveo / react-native-ui-kitten / src / playground / src / components / showcases / calendar / calendarStartDayOfWeek.component.tsx View on Github external
import React from 'react';
import {
  Calendar,
  NativeDateService,
} from '@ui-kitten/components';

const dateService = new NativeDateService('en', { startDayOfWeek: 1 });

export const CalendarStartDayOfWeekShowcase = () => {

  const [date, setDate] = React.useState(null);

  return (
    
  );
};
github akveo / react-native-ui-kitten / src / playground / src / components / showcases / datepicker / datepickerCustomLocale.component.tsx View on Github external
Layout,
  NativeDateService,
} from '@ui-kitten/components';

const i18n = {
  dayNames: {
    short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
    long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
  },
  monthNames: {
    short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dev'],
    long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
  },
};

const dateService = new NativeDateService('en', { i18n });

export const DatepickerCustomLocaleShowcase = () => {

  const [selectedDate, setSelectedDate] = React.useState(null);

  return (
    
      
    
  );
};
github akveo / react-native-ui-kitten / src / playground / src / components / showcases / calendar / calendarCustomLocale.component.tsx View on Github external
Calendar,
  NativeDateService,
} from '@ui-kitten/components';

const i18n = {
  dayNames: {
    short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
    long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
  },
  monthNames: {
    short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dev'],
    long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
  },
};

const dateService = new NativeDateService('en', { i18n });

export const CalendarCustomLocaleShowcase = () => {

  const [date, setDate] = React.useState(null);

  return (
    
  );
};
github akveo / react-native-ui-kitten / src / playground / src / scenes / calendar / type.ts View on Github external
},
};

const filterCalendar: ComponentShowcaseItem = {
  props: {
    ...defaultCalendar.props,
    filter: (date: Date): boolean => {
      return date.getDay() !== 0 && date.getDay() !== 6;
    },
  },
};

const mondayCalendar: ComponentShowcaseItem = {
  props: {
    ...defaultCalendar.props,
    dateService: new NativeDateService('en', {
      startDayOfWeek: 1,
    }),
  },
};

const defaultSection: ComponentShowcaseSection = {
  title: 'Default',
  items: [
    defaultCalendar,
  ],
};

const momentSection: ComponentShowcaseSection = {
  title: 'Moment',
  items: [
    momentCalendar,