This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseJSTDate(dateString: string): Date | null { | |
// 正規表現を使用して日付と時刻の情報を取得 | |
const match = /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/.exec(dateString); | |
if (!match) { | |
return null; | |
} | |
// 取得した情報を使用して新しいDateオブジェクトを作成 | |
const year = parseInt(match[1], 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mergeObjects(objA, objB) { | |
const keys = new Set([...Object.keys(objA), ...Object.keys(objB)]); | |
const result = {}; | |
keys.forEach(key => { | |
result[key] = objB[key] !== undefined ? objB[key] : objA[key]; | |
}); | |
return result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EditableCell: React.FC<any> = ({ row, field, control }) => { | |
return ( | |
<Controller | |
name={`${row.id}.${field}`} | |
control={control} | |
render={({ field: { ref, ...inputProps }, fieldState: { invalid, error } }) => ( | |
<TextField | |
{...inputProps} | |
error={invalid} | |
helperText={error?.message} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)[A-Za-z0-9^$*.[\]{}()?"!@#%&/\\,><':;|_~`=+\- ]{8,256}$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { makeStyles } from '@material-ui/core/styles'; | |
import Table from '@material-ui/core/Table'; | |
import TableBody from '@material-ui/core/TableBody'; | |
import TableCell from '@material-ui/core/TableCell'; | |
import TableContainer from '@material-ui/core/TableContainer'; | |
import TableHead from '@material-ui/core/TableHead'; | |
import TableRow from '@material-ui/core/TableRow'; | |
import Paper from '@material-ui/core/Paper'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sortComparator: (v1, v2, param1, param2) => { | |
if (v1 !== v2) { | |
// isCheckedの値が異なる場合、そのまま比較結果を返す | |
return v1 ? -1 : 1; | |
} | |
// isCheckedが同じ場合、isSelectedを比較する | |
const isSelected1 = param1.api.getRow(param1.id).isSelected; | |
const isSelected2 = param2.api.getRow(param2.id).isSelected; | |
if (isSelected1 !== isSelected2) { | |
// isSelectedの値が異なる場合、そのまま比較結果を返す |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import { DataGrid, GridColDef, GridRowsProp, GridColumns } from "@mui/x-data-grid"; | |
interface PinnedColumnsDataGridProps { | |
rows: GridRowsProp; | |
columns: GridColDef[]; | |
columnVisibilityModel: GridColumns; | |
onColumnVisibilityModelChange: (model: GridColumns) => void; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { withRouter } from 'next/router'; | |
// 型修正 | |
export const withComponentRouter = (Component: any) => { | |
return withRouter(({ router, ...props }) => { | |
// split at first `?` | |
const searchParams = new URLSearchParams(router.asPath.split(/\?/)[1]); | |
const query: { [key: string]: string } = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:11.10.1 | |
stages: | |
- test | |
run-unit-test: | |
stage: test | |
script: | |
- npm install # Install all dependencies | |
- npm test # Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/ | |
- https://www.npmjs.com/package/cordova-res | |
config.xml | |
resources/icon.png | |
resources/splash.png | |
ルートに配置してcordova-resコマンド実行 | |
プラットフォームごとの画像が自動生成され、config.xmlも自動で書き換わる | |
ただ、プラットフォーム毎に生成された画像がコピーされてない |
NewerOlder