Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 (
);
};
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 (
);
};
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 (
);
};
},
};
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,