Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Moment from "react-moment";
import {
SettingsElement,
SetupSentry,
ParseDefaultFilters,
ParseUIDefaults
} from "./AppBoot";
import { App } from "./App";
SetupSentry(SettingsElement());
// global timer for updating timestamps to human readable offsets
// this needs to be run before any instance
// https://www.npmjs.com/package/react-moment#pooled-timer
Moment.startPooledTimer();
// https://wetainment.com/testing-indexjs/
export default ReactDOM.render(
,
document.getElementById("root")
);
import React from 'react';
import Moment from 'react-moment';
import moment from 'moment/min/moment-with-locales';
import 'moment/locale/sv';
import { Text } from 'react-native';
import momentTZ from 'moment-timezone';
import 'moment-timezone';
import { getTimezone } from '@helpers/device';
import PropTypes from 'prop-types';
import I18n from 'react-native-i18n';
Moment.globalElement = Text;
Moment.startPooledTimer();
const changeFormat = (format) => {
if (format.includes('DD')) {
return format.replace('DD', 'MMM').replace('MMM', 'DD');
} else if (format.includes('Do')) {
return format.replace('Do', 'MMM').replace('MMM', 'Do');
}
return format;
};
export const isToday = dateTime => (moment(new Date(dateTime)).format('YYYYMMDD') === moment().format('YYYYMMDD'));
export const isWithinAWeek = dateTime => moment(new Date(dateTime)).isAfter(moment().subtract(7, 'days'));
export const isBeforeAWeek = dateTime => moment(new Date(dateTime)).isBefore(moment().subtract(7, 'days'));