Merge branch 'main' into tools-filtering

This commit is contained in:
AshAnand34
2025-07-18 14:45:15 -07:00
336 changed files with 21767 additions and 2122 deletions

View File

@@ -6,6 +6,7 @@ import ToolTextResult from '@components/result/ToolTextResult';
import { GetGroupsType } from '@components/options/ToolOptions';
import { CardExampleType } from '@components/examples/ToolExamples';
import { checkLeapYear } from './service';
import { useTranslation } from 'react-i18next';
const initialValues = {};
@@ -56,6 +57,7 @@ export default function ConvertDaysToHours({
title,
longDescription
}: ToolComponentProps) {
const { t } = useTranslation('time');
const [input, setInput] = useState<string>('');
const [result, setResult] = useState<string>('');
@@ -75,7 +77,10 @@ export default function ConvertDaysToHours({
getGroups={getGroups}
setInput={setInput}
compute={compute}
toolInfo={{ title: `What is a ${title}?`, description: longDescription }}
toolInfo={{
title: t('checkLeapYears.toolInfo.title', { title }),
description: longDescription
}}
exampleCards={exampleCards}
/>
);

View File

@@ -3,13 +3,14 @@ import { lazy } from 'react';
export const tool = defineTool('time', {
path: 'check-leap-years',
name: 'Check Leap Years',
icon: 'arcticons:calendar-simple-29',
description:
' You can check if a given calendar year is a leap year. You can enter one or many different years into the input field with one date per line and get the answer to the test question of whether the given year is a leap year.',
shortDescription: 'Check if a year is a leap year',
keywords: ['check', 'leap', 'years'],
longDescription: `This is a quick online utility for testing if the given year is a leap year. Just as a reminder, a leap year has 366 days, which is one more day than a common year. This extra day is added to the month of February and it falls on February 29th. There's a simple mathematical formula for calculating if the given year is a leap year. Leap years are those years that are divisible by 4 but not divisible by 100, as well as years that are divisible by 100 and 400 simultaneously. Our algorithm checks each input year using this formula and outputs the year's status. For example, if you enter the value "2025" as input, the program will display "2025 is not a leap year.", and for the value "2028", the status will be "2028 is a leap year.". You can also enter multiple years as the input in a column and get a matching column of statuses as the output.`,
userTypes: ['General Users', 'Students'],
component: lazy(() => import('./index'))
icon: 'material-symbols:calendar-month',
keywords: ['leap', 'year', 'calendar', 'date'],
component: lazy(() => import('./index')),
i18n: {
name: 'time:checkLeapYears.title',
description: 'time:checkLeapYears.description',
shortDescription: 'time:checkLeapYears.shortDescription',
userTypes: ['General Users', 'Students']
}
});

View File

@@ -8,6 +8,7 @@ import { GetGroupsType } from '@components/options/ToolOptions';
import { CardExampleType } from '@components/examples/ToolExamples';
import CheckboxWithDesc from '@components/options/CheckboxWithDesc';
import { convertDaysToHours } from './service';
import { useTranslation } from 'react-i18next';
const initialValues = {
hoursFlag: false
@@ -18,7 +19,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
title: 'Full Days to Hours',
description:
'This example calculates how many hours there are in 1 day, in one week (7 days), in one month (30 days), and in even longer time periods. To see all the results at once, we enter each individual day value on a new line. We also use the "days" suffix in the input and add the "hours" suffix to the output.',
sampleText: `1 day
sampleText: `1 day
7 days
30 days
90 days
@@ -62,6 +63,7 @@ export default function ConvertDaysToHours({
title,
longDescription
}: ToolComponentProps) {
const { t } = useTranslation('time');
const [input, setInput] = useState<string>('');
const [result, setResult] = useState<string>('');
@@ -74,14 +76,14 @@ export default function ConvertDaysToHours({
updateField
}) => [
{
title: 'Hours Name',
title: t('convertDaysToHours.hoursName'),
component: (
<Box>
<CheckboxWithDesc
onChange={(val) => updateField('hoursFlag', val)}
checked={values.hoursFlag}
title={'Add Hours Name'}
description={'Append the string hours to output values'}
title={t('convertDaysToHours.addHoursName')}
description={t('convertDaysToHours.addHoursNameDescription')}
/>
</Box>
)
@@ -98,7 +100,10 @@ export default function ConvertDaysToHours({
getGroups={getGroups}
setInput={setInput}
compute={compute}
toolInfo={{ title: `What is a ${title}?`, description: longDescription }}
toolInfo={{
title: t('convertDaysToHours.toolInfo.title'),
description: t('convertDaysToHours.toolInfo.description')
}}
exampleCards={exampleCards}
/>
);

View File

@@ -2,13 +2,15 @@ import { defineTool } from '@tools/defineTool';
import { lazy } from 'react';
export const tool = defineTool('time', {
name: 'Convert days to hours',
path: 'convert-days-to-hours',
icon: 'material-symbols:schedule',
description:
'Convert days to hours with simple calculations. Useful for time tracking and scheduling.',
shortDescription: 'Convert days to hours easily.',
keywords: ['days', 'hours', 'convert', 'time', 'calculation'],
userTypes: ['General Users', 'Students'],
component: lazy(() => import('./index'))
keywords: ['days', 'hours', 'convert', 'time'],
component: lazy(() => import('./index')),
i18n: {
name: 'time:convertDaysToHours.title',
description: 'time:convertDaysToHours.description',
shortDescription: 'time:convertDaysToHours.shortDescription',
userTypes: ['General Users', 'Students']
}
});

View File

@@ -2,13 +2,15 @@ import { defineTool } from '@tools/defineTool';
import { lazy } from 'react';
export const tool = defineTool('time', {
name: 'Convert hours to days',
path: 'convert-hours-to-days',
icon: 'material-symbols:schedule',
description:
'Convert hours to days with simple calculations. Useful for time tracking and scheduling.',
shortDescription: 'Convert hours to days easily.',
keywords: ['hours', 'days', 'convert', 'time', 'calculation'],
userTypes: ['General Users', 'Students'],
component: lazy(() => import('./index'))
keywords: ['hours', 'days', 'convert', 'time'],
component: lazy(() => import('./index')),
i18n: {
name: 'time:convertHoursToDays.title',
description: 'time:convertHoursToDays.description',
shortDescription: 'time:convertHoursToDays.shortDescription',
userTypes: ['General Users', 'Students']
}
});

View File

@@ -8,6 +8,7 @@ import { GetGroupsType } from '@components/options/ToolOptions';
import { CardExampleType } from '@components/examples/ToolExamples';
import CheckboxWithDesc from '@components/options/CheckboxWithDesc';
import { convertSecondsToTime } from './service';
import { useTranslation } from 'react-i18next';
const initialValues = {
paddingFlag: false
@@ -68,6 +69,7 @@ export default function SecondsToTime({
title,
longDescription
}: ToolComponentProps) {
const { t } = useTranslation('time');
const [input, setInput] = useState<string>('');
const [result, setResult] = useState<string>('');
@@ -80,14 +82,14 @@ export default function SecondsToTime({
updateField
}) => [
{
title: 'Time Padding',
title: t('convertSecondsToTime.timePadding'),
component: (
<Box>
<CheckboxWithDesc
onChange={(val) => updateField('paddingFlag', val)}
checked={values.paddingFlag}
title={'Add Padding'}
description={'Add zero padding to hours, minutes, and seconds.'}
title={t('convertSecondsToTime.addPadding')}
description={t('convertSecondsToTime.addPaddingDescription')}
/>
</Box>
)
@@ -104,7 +106,10 @@ export default function SecondsToTime({
getGroups={getGroups}
setInput={setInput}
compute={compute}
toolInfo={{ title: `What is a ${title}?`, description: longDescription }}
toolInfo={{
title: t('convertSecondsToTime.toolInfo.title', { title }),
description: longDescription
}}
exampleCards={exampleCards}
/>
);

View File

@@ -2,13 +2,15 @@ import { defineTool } from '@tools/defineTool';
import { lazy } from 'react';
export const tool = defineTool('time', {
name: 'Convert seconds to time',
path: 'convert-seconds-to-time',
icon: 'material-symbols:schedule',
description:
'Convert seconds to readable time format (HH:MM:SS). Useful for time calculations and formatting.',
shortDescription: 'Convert seconds to time format (HH:MM:SS)',
keywords: ['seconds', 'time', 'convert', 'format', 'HH:MM:SS'],
userTypes: ['General Users', 'Students'],
component: lazy(() => import('./index'))
keywords: ['seconds', 'time', 'convert', 'format'],
component: lazy(() => import('./index')),
i18n: {
name: 'time:convertSecondsToTime.title',
description: 'time:convertSecondsToTime.description',
shortDescription: 'time:convertSecondsToTime.shortDescription',
userTypes: ['General Users', 'Students']
}
});

View File

@@ -5,6 +5,7 @@ import ToolTextInput from '@components/input/ToolTextInput';
import ToolTextResult from '@components/result/ToolTextResult';
import { CardExampleType } from '@components/examples/ToolExamples';
import { convertTimetoSeconds } from './service';
import { useTranslation } from 'react-i18next';
const initialValues = {};
type InitialValuesType = typeof initialValues;
@@ -75,6 +76,7 @@ export default function TimeToSeconds({
title,
longDescription
}: ToolComponentProps) {
const { t } = useTranslation('time');
const [input, setInput] = useState<string>('');
const [result, setResult] = useState<string>('');
@@ -92,7 +94,10 @@ export default function TimeToSeconds({
getGroups={null}
setInput={setInput}
compute={compute}
toolInfo={{ title: `What is a ${title}?`, description: longDescription }}
toolInfo={{
title: t('convertTimeToSeconds.toolInfo.title', { title }),
description: longDescription
}}
exampleCards={exampleCards}
/>
);

View File

@@ -2,13 +2,15 @@ import { defineTool } from '@tools/defineTool';
import { lazy } from 'react';
export const tool = defineTool('time', {
name: 'Convert time to seconds',
path: 'convert-time-to-seconds',
icon: 'material-symbols:schedule',
description:
'Convert time format (HH:MM:SS) to total seconds. Useful for time calculations and programming.',
shortDescription: 'Convert time format (HH:MM:SS) to seconds',
keywords: ['time', 'seconds', 'convert', 'format', 'HH:MM:SS'],
userTypes: ['General Users', 'Students', 'Developers'],
component: lazy(() => import('./index'))
component: lazy(() => import('./index')),
i18n: {
name: 'time:convertTimeToSeconds.title',
description: 'time:convertTimeToSeconds.description',
shortDescription: 'time:convertTimeToSeconds.shortDescription',
userTypes: ['General Users', 'Students', 'Developers']
}
});

View File

@@ -2,12 +2,8 @@ import { defineTool } from '@tools/defineTool';
import { lazy } from 'react';
export const tool = defineTool('time', {
name: 'Crontab explainer',
path: 'crontab-guru',
icon: 'mdi:calendar-clock',
description:
'Parse, validate, and explain crontab expressions in plain English.',
shortDescription: 'Crontab expression parser and explainer',
icon: 'material-symbols:schedule',
keywords: [
'crontab',
'cron',
@@ -18,8 +14,11 @@ export const tool = defineTool('time', {
'parser',
'explain'
],
longDescription:
'Enter a crontab expression (like "35 16 * * 0-5") to get a human-readable explanation and validation. Useful for understanding and debugging cron schedules. Inspired by crontab.guru.',
userTypes: ['Developers'],
component: lazy(() => import('./index'))
component: lazy(() => import('./index')),
i18n: {
name: 'time:crontabGuru.title',
description: 'time:crontabGuru.description',
shortDescription: 'time:crontabGuru.shortDescription',
userTypes: ['Developers']
}
});

View File

@@ -11,6 +11,7 @@ import {
} from './service';
import * as Yup from 'yup';
import { CardExampleType } from '@components/examples/ToolExamples';
import { useTranslation } from 'react-i18next';
type TimeUnit =
| 'milliseconds'
@@ -120,11 +121,12 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
];
export default function TimeBetweenDates() {
const { t } = useTranslation('time');
const [result, setResult] = useState<string>('');
return (
<ToolContent
title="Time Between Dates"
title={t('timeBetweenDates.title')}
inputComponent={null}
resultComponent={
result ? (
@@ -153,29 +155,28 @@ export default function TimeBetweenDates() {
validationSchema={validationSchema}
exampleCards={exampleCards}
toolInfo={{
title: 'Time Between Dates Calculator',
description:
'Calculate the exact time difference between two dates and times, with support for different timezones. This tool provides a detailed breakdown of the time difference in various units (years, months, days, hours, minutes, and seconds).'
title: t('timeBetweenDates.toolInfo.title'),
description: t('timeBetweenDates.toolInfo.description')
}}
getGroups={({ values, updateField }) => [
{
title: 'Start Date & Time',
title: t('timeBetweenDates.startDateTime'),
component: (
<Box>
<TextFieldWithDesc
description="Start Date"
description={t('timeBetweenDates.startDate')}
value={values.startDate}
onOwnChange={(val) => updateField('startDate', val)}
type="date"
/>
<TextFieldWithDesc
description="Start Time"
description={t('timeBetweenDates.startTime')}
value={values.startTime}
onOwnChange={(val) => updateField('startTime', val)}
type="time"
/>
<SelectWithDesc
description="Start Timezone"
description={t('timeBetweenDates.startTimezone')}
selected={values.startTimezone}
onChange={(val: string) => updateField('startTimezone', val)}
options={timezoneOptions}
@@ -184,23 +185,23 @@ export default function TimeBetweenDates() {
)
},
{
title: 'End Date & Time',
title: t('timeBetweenDates.endDateTime'),
component: (
<Box>
<TextFieldWithDesc
description="End Date"
description={t('timeBetweenDates.endDate')}
value={values.endDate}
onOwnChange={(val) => updateField('endDate', val)}
type="date"
/>
<TextFieldWithDesc
description="End Time"
description={t('timeBetweenDates.endTime')}
value={values.endTime}
onOwnChange={(val) => updateField('endTime', val)}
type="time"
/>
<SelectWithDesc
description="End Timezone"
description={t('timeBetweenDates.endTimezone')}
selected={values.endTimezone}
onChange={(val: string) => updateField('endTimezone', val)}
options={timezoneOptions}

View File

@@ -2,14 +2,15 @@ import { defineTool } from '@tools/defineTool';
import { lazy } from 'react';
export const tool = defineTool('time', {
name: 'Time Between Dates',
path: 'time-between-dates',
icon: 'tabler:clock-minus',
description:
'Calculate the time difference between two dates with timezone support. Get days, hours, minutes, and seconds between dates.',
shortDescription:
'Calculate time difference between two dates with timezone support',
keywords: ['time', 'dates', 'difference', 'calculate', 'between'],
userTypes: ['General Users', 'Students'],
component: lazy(() => import('./index'))
icon: 'material-symbols:schedule',
keywords: ['dates', 'time', 'difference', 'duration', 'calculate'],
component: lazy(() => import('./index')),
i18n: {
name: 'time:timeBetweenDates.title',
description: 'time:timeBetweenDates.description',
shortDescription: 'time:timeBetweenDates.shortDescription',
userTypes: ['General Users', 'Students', 'Developers']
}
});

View File

@@ -9,6 +9,7 @@ import { CardExampleType } from '@components/examples/ToolExamples';
import CheckboxWithDesc from '@components/options/CheckboxWithDesc';
import SimpleRadio from '@components/options/SimpleRadio';
import { truncateClockTime } from './service';
import { useTranslation } from 'react-i18next';
const initialValues = {
onlySecond: true,
@@ -67,6 +68,7 @@ export default function TruncateClockTime({
title,
longDescription
}: ToolComponentProps) {
const { t } = useTranslation('time');
const [input, setInput] = useState<string>('');
const [result, setResult] = useState<string>('');
@@ -86,48 +88,48 @@ export default function TruncateClockTime({
updateField
}) => [
{
title: 'Truncation Side',
title: t('truncateClockTime.truncationSide'),
component: (
<Box>
<SimpleRadio
onClick={() => updateField('onlySecond', true)}
checked={values.onlySecond}
title={'Truncate Only Seconds'}
description={'Drop the seconds component from each clock time.'}
title={t('truncateClockTime.truncateOnlySeconds')}
description={t('truncateClockTime.truncateOnlySecondsDescription')}
/>
<SimpleRadio
onClick={() => updateField('onlySecond', false)}
checked={!values.onlySecond}
title={'Truncate Minutes and Seconds'}
description={
'Drop both the minutes and seconds components from each clock time.'
}
title={t('truncateClockTime.truncateMinutesAndSeconds')}
description={t(
'truncateClockTime.truncateMinutesAndSecondsDescription'
)}
/>
</Box>
)
},
{
title: 'Print Dropped Components',
title: t('truncateClockTime.printDroppedComponents'),
component: (
<Box>
<CheckboxWithDesc
onChange={(val) => updateField('zeroPrint', val)}
checked={values.zeroPrint}
title={'Zero-print Truncated Parts'}
description={'Display the dropped parts as zero values "00".'}
title={t('truncateClockTime.zeroPrintTruncatedParts')}
description={t('truncateClockTime.zeroPrintDescription')}
/>
</Box>
)
},
{
title: 'Time Padding',
title: t('truncateClockTime.timePadding'),
component: (
<Box>
<CheckboxWithDesc
onChange={(val) => updateField('zeroPadding', val)}
checked={values.zeroPadding}
title={'Use Zero Padding'}
description={'Make all time components always be two digits wide.'}
title={t('truncateClockTime.useZeroPadding')}
description={t('truncateClockTime.zeroPaddingDescription')}
/>
</Box>
)
@@ -144,7 +146,10 @@ export default function TruncateClockTime({
getGroups={getGroups}
setInput={setInput}
compute={compute}
toolInfo={{ title: `What is a ${title}?`, description: longDescription }}
toolInfo={{
title: t('truncateClockTime.toolInfo.title', { title }),
description: longDescription
}}
exampleCards={exampleCards}
/>
);

View File

@@ -3,12 +3,14 @@ import { lazy } from 'react';
export const tool = defineTool('time', {
path: 'truncate-clock-time',
name: 'Truncate Clock Time',
icon: 'mdi:clock-remove-outline',
description:
'With this browser-based application, you can truncate a clock time and drop the minutes and/or seconds components from it. If you drop the seconds, you will be left with hours and minutes. For example, "13:23:45" will be truncated to "13:23". If you drop both minutes and seconds, you will be left with just hours. For example, "13:23:45" will be truncated to just "13". Additionally, in the options, you can add or remove the hours and minutes padding and also print the dropped time component as a zero if needed.',
shortDescription: 'Quickly convert clock time in H:M:S format to seconds.',
keywords: ['truncate', 'time', 'clock'],
userTypes: ['General Users', 'Students'],
component: lazy(() => import('./index'))
icon: 'material-symbols:schedule',
keywords: ['time', 'truncate', 'clock', 'round', 'precision'],
component: lazy(() => import('./index')),
i18n: {
name: 'time:truncateClockTime.title',
description: 'time:truncateClockTime.description',
shortDescription: 'time:truncateClockTime.shortDescription',
userTypes: ['General Users', 'Students', 'Developers']
}
});