Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
空白の変更を非表示
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
テキストスタイル
外観を変更
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
Gantt Date Normalization
作成日
3 か月前
差分は期限切れになりません
クリア
エクスポート
共有
説明
2 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
18 行
すべてコピー
45 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
57 行
すべてコピー
/**
/**
* Stable date conversion helpers for Gantt ↔ Supabase round-trips.
* Stable date conversion helpers for Gantt ↔ Supabase round-trips.
*
*
* The Gantt component works with JS Date objects.
* The Gantt component works with JS Date objects.
* Supabase stores timestamptz as ISO-8601 strings.
* Supabase stores timestamptz as ISO-8601 strings.
*/
*/
コピー
コピー済み
コピー
コピー済み
/** Convert a JS Date
to an ISO-8601 string for Supabase. */
export function dateToISO(d: Date |
null | undefined): string | null {
function parseGanttDateString(value: string): Date | null {
if (!d) return null;
const match = value.match(
return
d
.toISOString();
/^(\d{2})-(\d{2})-(\d{4})(?:\s+(\d{2}):(\d{2})(?::(\d{2}))?)?$/,
);
if (!match) return null;
const [, day, month, year, hours = "00", minutes = "00", seconds = "00"] = match;
const date = new Date(
Number(year),
Number(month) - 1,
Number(day),
Number(hours),
Number(minutes),
Number(seconds),
);
return Number.isNaN(date.getTime()) ? null : date;
}
/** Convert a JS Date
or supported Gantt string
to an ISO-8601 string for Supabase. */
export function dateToISO(d: Date |
string |
null | undefined): string | null {
if (!d) return null;
if (d instanceof Date) {
return Number.isNaN(d.getTime()) ? null : d.toISOString();
}
if (typeof d === "string") {
const parsed = parseGanttDateString(d) ?? new Date(d);
return
Number.isNaN(parsed.getTime()) ? null : parsed
.toISOString();
}
return null;
}
}
コピー
コピー済み
コピー
コピー済み
/** Convert an ISO-8601 string (or null) to a JS Date for Gantt. */
/** Convert an ISO-8601 string (or null) to a JS Date for Gantt. */
export function isoToDate(s: string | null | undefined): Date {
export function isoToDate(s: string | null | undefined): Date {
if (!s) return new Date();
if (!s) return new Date();
return new Date(s);
return new Date(s);
}
}
保存された差分
原文
ファイルを開く
/** * Stable date conversion helpers for Gantt ↔ Supabase round-trips. * * The Gantt component works with JS Date objects. * Supabase stores timestamptz as ISO-8601 strings. */ /** Convert a JS Date to an ISO-8601 string for Supabase. */ export function dateToISO(d: Date | null | undefined): string | null { if (!d) return null; return d.toISOString(); } /** Convert an ISO-8601 string (or null) to a JS Date for Gantt. */ export function isoToDate(s: string | null | undefined): Date { if (!s) return new Date(); return new Date(s); }
変更されたテキスト
ファイルを開く
/** * Stable date conversion helpers for Gantt ↔ Supabase round-trips. * * The Gantt component works with JS Date objects. * Supabase stores timestamptz as ISO-8601 strings. */ function parseGanttDateString(value: string): Date | null { const match = value.match( /^(\d{2})-(\d{2})-(\d{4})(?:\s+(\d{2}):(\d{2})(?::(\d{2}))?)?$/, ); if (!match) return null; const [, day, month, year, hours = "00", minutes = "00", seconds = "00"] = match; const date = new Date( Number(year), Number(month) - 1, Number(day), Number(hours), Number(minutes), Number(seconds), ); return Number.isNaN(date.getTime()) ? null : date; } /** Convert a JS Date or supported Gantt string to an ISO-8601 string for Supabase. */ export function dateToISO(d: Date | string | null | undefined): string | null { if (!d) return null; if (d instanceof Date) { return Number.isNaN(d.getTime()) ? null : d.toISOString(); } if (typeof d === "string") { const parsed = parseGanttDateString(d) ?? new Date(d); return Number.isNaN(parsed.getTime()) ? null : parsed.toISOString(); } return null; } /** Convert an ISO-8601 string (or null) to a JS Date for Gantt. */ export function isoToDate(s: string | null | undefined): Date { if (!s) return new Date(); return new Date(s); }
違いを見つける