Skip to content

Getting the wrong day of transaction #984

@ldco2016

Description

@ldco2016

Describe the bug
When a user purchases a ticket for an event on 01/29, the transaction history shows the date of purchase as being 01/28.

To Reproduce
Clone this CodeSandbox to reproduce the bug.

Expected behavior
I expect that the transaction date should be whatever day the ticket was purchased.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

import React from 'react';
import {View, Text, StyleSheet, ScrollView} from 'react-native';
import EmptyTransactions from './EmptyTransactions';
import {Divider} from 'common-components';
import {v2Colors, v2Fonts} from 'theme';
import format from 'date-fns/format';
import PropTypes from 'prop-types';

const propTypes = {
  transactions: PropTypes.array,
};

const TransactionsTable = ({transactions = []}) => (
  <View style={styles.container}>
    <View style={styles.tableHeader}>
      <View style={styles.headerCol}>
        <Text style={styles.text}>{'DATE'}</Text>
      </View>
      <View style={styles.headerCol}>
        <Text style={styles.text}>{'PRODUCT'}</Text>
      </View>
      <View style={styles.headerCol}>
        <Text style={styles.text}>{'METHOD'}</Text>
      </View>
      <View style={styles.headerCol}>
        <Text style={styles.text}>{'$'}</Text>
      </View>
    </View>
    {!transactions.length && <EmptyTransactions />}
    {Boolean(transactions.length) && (
      <ScrollView showsVerticalScrollIndicator={false}>
        {transactions.map(t => (
          <View key={t.Key}>
            <View style={styles.tableRow}>
              <View style={styles.headerCol}>
                <Text style={styles.text}>
                  {format(t.DateTime, 'MM-DD-YYYY')}
                </Text>

The version number of date-fns is 1.29.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug or Bug fixeshelp wantedExtra attention is neededhighThis issue has a high priorityto investigateNeeds more investigation from the mantainersv7

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions