How to use @ui-kitten/moment - 2 common examples

To help you get started, we’ve selected a few @ui-kitten/moment 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 / datepicker / datepickerMoment.component.tsx View on Github external
/**
 * IMPORTANT: To use Moment make sure to install Moment Date Service
 * npm i @ui-kitten/moment
 */

import React from 'react';
import { StyleSheet } from 'react-native';
import {
  Datepicker,
  Layout,
} from '@ui-kitten/components';
import { MomentDateService } from '@ui-kitten/moment';

const dateService = new MomentDateService();

export const DatepickerMomentShowcase = () => {

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

  return (
    <Layout style={styles.container}>
      <Datepicker
        placeholder='Pick Date'
        date={date}
        dateService={dateService}
        onSelect={setDate}
      />
    </Layout>
  );
};
github akveo / react-native-ui-kitten / src / playground / src / components / showcases / calendar / calendarMoment.component.tsx View on Github external
/**
 * IMPORTANT: To use Moment make sure to install Moment Date Service
 * npm i @ui-kitten/moment
 */

import React from 'react';
import { Calendar } from '@ui-kitten/components';
import { MomentDateService } from '@ui-kitten/moment';
import moment from 'moment';

const dateService = new MomentDateService();

export const CalendarMomentShowcase = () => {

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

  return (
    <Calendar
      dateService={dateService}
      date={date}
      onSelect={setDate}
    />
  );
};

@ui-kitten/moment

moment.js services for UI Kitten

MIT
Latest version published 8 months ago

Package Health Score

77 / 100
Full package analysis

Popular @ui-kitten/moment functions