Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Infiniflow Ragflow Date Utils

From Leeroopedia
Knowledge Sources
Domains Frontend, Utilities
Last Updated 2026-02-12 06:00 GMT

Overview

Concrete date and time formatting utilities for consistent timestamp display across the RAGFlow frontend.

Description

The utils/date.ts module provides functions for formatting dates and timestamps into human-readable strings, computing relative time ("2 hours ago"), and handling timezone conversions for the frontend display layer.

Usage

Import these utilities in table columns, card metadata, and any UI element that displays timestamps.

Code Reference

Source Location

Signature

export function formatDate(timestamp: number, format?: string): string;
export function formatRelativeTime(timestamp: number): string;

Import

import { formatDate, formatRelativeTime } from '@/utils/date';

I/O Contract

Inputs

Name Type Required Description
timestamp number Yes Unix timestamp in milliseconds
format string No Date format pattern

Outputs

Name Type Description
formatDate() string Formatted date string
formatRelativeTime() string Relative time string (e.g., "2h ago")

Usage Examples

import { formatDate } from '@/utils/date';
const display = formatDate(1707696000000); // "2024-02-12 00:00"

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment