mattermost-mobile/app/components/post_list/date_header/utils.js
Jesse Hallam 36dd3f19e2 MM-11198: avoid duplicate date line keys (#1901)
* MM-11198: avoid duplicate keys in date lines

Ensure each dateline rendered as part of search, recent mentions, or flagged post list has a unique key, even if the same date itself appears multiple times.

* update post_list.test.js to actually test date boundaries, relying on TZ=utc export in package.json

* unit test makePreparePostIdsForSearchPosts

* fix eslint issues

* try TZ=GMT

* encode date lines using timestamps instead

This requires a few extra changes to the post list proper, but largely
simplifies things anyway.
2018-07-09 18:35:43 -04:00

6 lines
244 B
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {DATE_LINE} from 'app/selectors/post_list';
export const isDateLine = (dateString) => dateString.indexOf(DATE_LINE) === 0;