Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ updates:
cooldown:
default-days: 3
open-pull-requests-limit: 10
groups:
vitest:
patterns:
- 'vitest'
- '@vitest/coverage*'
ignore:
- dependency-name: 'react-native'
- dependency-name: 'react'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

- name: Test
if: matrix.variant == 'default'
run: yarn test --run --coverage --reporter=junit --outputFile=test-report.junit.xml
run: yarn test --ci --coverage --reporters=default --reporters=jest-junit

- name: Upload test results to Codecov
if: ${{ !cancelled() && matrix.variant == 'default' }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ licenses.json

# Coverage
coverage/
test-report.junit.xml

# Android Studio
.idea/
9 changes: 2 additions & 7 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import reactHooks from 'eslint-plugin-react-hooks'
import tseslint from 'typescript-eslint'
import eslintConfigPrettier from 'eslint-config-prettier/flat'
import sonarjs from 'eslint-plugin-sonarjs'
import vitest from '@vitest/eslint-plugin'
import jest from 'eslint-plugin-jest'
import globals from 'globals'

export default defineConfig(
Expand Down Expand Up @@ -43,12 +43,7 @@ export default defineConfig(
sonarjs.configs.recommended,
{
files: ['**/*.test.ts', '**/*.test.tsx'],
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
},
...jest.configs['flat/recommended'],
},
{
files: ['**/*.{ts,tsx}'],
Expand Down
37 changes: 27 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"typecheck:foss": "tsc -p tsconfig.foss.json --noEmit",
"lint": "eslint .",
"format": "prettier --write .",
"test": "vitest",
"test": "jest",
"generate-licenses": "yarn dlx license-checker-rseidelsohn --production --json --out src/licenses.json"
},
"expo": {
Expand Down Expand Up @@ -71,31 +71,48 @@
"react-native-web": "0.21.2",
"react-native-worklets": "0.10.0"
},
"jest": {
"preset": "jest-expo",
"roots": [
"<rootDir>/src"
],
"setupFilesAfterEnv": [
"<rootDir>/src/test/jestSetup.ts"
],
"collectCoverageFrom": [
"src/**/*.{ts,tsx}",
"!src/**/*.test.{ts,tsx}",
"!src/**/*.d.ts",
"!src/i18n/locales/*.ts",
"!src/test/**"
]
},
"jest-junit": {
"outputName": "test-report.junit.xml"
},
"private": true,
"packageManager": "yarn@4.12.0",
"devDependencies": {
"@babel/core": "^7.29.0",
"@eslint/js": "9.39.2",
"@rolldown/plugin-babel": "0.2.3",
"@jest/globals": "^29.7.0",
"@react-native/jest-preset": "0.86.0",
"@types/papaparse": "5.5.2",
"@types/react": "~19.2.14",
"@types/react-dom": "~19.2.0",
"@types/react-native-web": "0.19.2",
"@vitejs/plugin-react": "6.0.3",
"@vitest/coverage-v8": "4.1.9",
"@vitest/eslint-plugin": "1.6.20",
"babel-plugin-module-resolver": "5.0.3",
"cross-env": "10.1.0",
"eslint": "9.39.2",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-jest": "29.15.4",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "7.1.1",
"eslint-plugin-sonarjs": "4.1.0",
"jest": "~29.7.0",
"jest-expo": "~57.0.1",
"jest-junit": "17.0.0",
"prettier": "3.9.4",
"rolldown": "1.1.3",
"typescript": "~6.0.3",
"typescript-eslint": "8.62.1",
"vite": "8.1.0",
"vitest": "4.1.9"
"typescript-eslint": "8.62.1"
}
}
25 changes: 1 addition & 24 deletions src/components/AdaptiveDateTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useState } from 'react'
import { Platform, View } from 'react-native'
import { Portal, Dialog, Button } from 'react-native-paper'
import DateTimePicker from '@expo/ui/community/datetime-picker'
import { shiftToUTC, shiftToLocal } from '../utils/dateShift'

export interface AdaptiveDateTimePickerProps {
visible: boolean
Expand All @@ -14,30 +15,6 @@ export interface AdaptiveDateTimePickerProps {
confirmLabel: string
}

const shiftToUTC = (date: Date) => {
return new Date(
Date.UTC(
date.getFullYear(),
date.getMonth(),
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
),
)
}

const shiftToLocal = (date: Date) => {
return new Date(
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate(),
date.getUTCHours(),
date.getUTCMinutes(),
date.getUTCSeconds(),
)
}

const AdaptiveDateTimePicker = ({
visible,
onDismiss,
Expand Down
Loading