mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-15 07:30:30 +00:00
22 lines
742 B
TypeScript
22 lines
742 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {withDatabase, withObservables} from '@nozbe/watermelondb/react';
|
|
import {of as of$} from 'rxjs';
|
|
import {switchMap} from 'rxjs/operators';
|
|
|
|
import {observeCurrentUser} from '@queries/servers/user';
|
|
import {getTimezone} from '@utils/user';
|
|
|
|
import DateInputElement from './date_input_element';
|
|
|
|
import type {WithDatabaseArgs} from '@typings/database/database';
|
|
|
|
const enhanced = withObservables([], ({database}: WithDatabaseArgs) => ({
|
|
userTimezone: observeCurrentUser(database).pipe(
|
|
switchMap((user) => of$(getTimezone(user?.timezone))),
|
|
),
|
|
}));
|
|
|
|
export default withDatabase(enhanced(DateInputElement));
|