• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 10283466578

07 Aug 2024 11:30AM UTC coverage: 17.548% (-0.2%) from 17.734%
10283466578

Pull #793

github

web-flow
Merge e709c0064 into 4854acca2
Pull Request #793: feat: record history

1387 of 2823 branches covered (49.13%)

6 of 1033 new or added lines in 43 files covered. (0.58%)

34 existing lines in 5 files now uncovered.

14088 of 80281 relevant lines covered (17.55%)

1.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/sdk/src/components/cell-value/cell-date/CellDate.tsx
1
import { DateFormattingPreset, formatDateToString } from '@teable/core';
×
2
import type { IDatetimeFormatting } from '@teable/core';
×
3
import { cn } from '@teable/ui-lib';
×
4
import dayjs from 'dayjs';
×
5
import { useMemo } from 'react';
×
NEW
6
import { OverflowTooltip } from '../components';
×
7
import type { ICellValue } from '../type';
×
8

×
9
interface ICellDate extends ICellValue<string> {
×
10
  formatting?: IDatetimeFormatting | null;
×
11
}
×
12

×
13
export const CellDate = (props: ICellDate) => {
×
NEW
14
  const { value, formatting, maxLine, className, style } = props;
×
15

×
16
  const displayValue = useMemo(() => {
×
17
    if (value == null) return '';
×
18
    if (formatting == null) return dayjs(value).format(DateFormattingPreset.ISO);
×
19
    return formatDateToString(value, formatting);
×
20
  }, [value, formatting]);
×
21

×
22
  return (
×
NEW
23
    <OverflowTooltip
×
NEW
24
      text={displayValue}
×
NEW
25
      maxLine={maxLine}
×
NEW
26
      className={cn('w-full text-[13px]', className)}
×
NEW
27
      style={style}
×
NEW
28
    />
×
29
  );
×
30
};
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc