Compare commits

...

8 Commits

Author SHA1 Message Date
Abhinav Raut
3d76cce66a Merge pull request #151 from csr4422/enhancement/relative-time-months
Add month support to getRelativeTime
2025-10-03 13:39:14 +05:30
csr4422
4b8f30184a style: adjust spacing 2025-10-03 13:09:00 +05:30
csr4422
e4018ddab8 Add month support to getRelativeTime 2025-10-01 16:22:02 +05:30
Abhinav Raut
02e8a43587 Update README.md 2025-09-30 14:45:51 +05:30
Abhinav Raut
f3acc37405 update version to 0.8.0-beta in package.json
remove caution note about alpha status from README.md
2025-09-30 14:35:53 +05:30
Abhinav Raut
562babf222 Merge pull request #150 from csr4422/fix/convert-select-values
Fix: convert select values to number or null before submit
2025-09-29 23:01:36 +05:30
csr4422
93e94432f5 feat: add None option to SLA and Business Hours select boxes 2025-09-29 21:20:20 +05:30
csr4422
ec63604163 Fix: convert select values to number or null before submit 2025-09-29 17:18:36 +05:30
4 changed files with 14 additions and 14 deletions

View File

@@ -10,8 +10,6 @@ Modern, open source, self-hosted customer support desk. Single binary app.
Visit [libredesk.io](https://libredesk.io) for more info. Check out the [**Live demo**](https://demo.libredesk.io/).
> **CAUTION:** This project is currently in **alpha**. Features and APIs may change and are not yet fully tested.
## Features
- **Multi Shared Inbox**
@@ -85,11 +83,6 @@ __________________
## Developers
If you are interested in contributing, refer to the [developer setup](https://docs.libredesk.io/contributing/developer-setup). The backend is written in Go and the frontend is Vue js 3 with Shadcn for UI components.
## Development Status
Libredesk is under active development.
Track roadmap and progress on the GitHub Project Board: [https://github.com/users/abhinavxd/projects/1](https://github.com/users/abhinavxd/projects/1)
## Translators
You can help translate Libredesk into your language on [Crowdin](https://crowdin.com/project/libredesk).

View File

@@ -1,6 +1,6 @@
{
"name": "libredesk",
"version": "0.6.0-alpha",
"version": "0.8.0-beta",
"private": true,
"type": "module",
"scripts": {

View File

@@ -57,9 +57,8 @@
<Input type="number" placeholder="0" v-bind="componentField" />
</FormControl>
<FormDescription>
Maximum number of conversations that can be auto-assigned to an agent,
conversations in "Resolved" or "Closed" states do not count toward this limit. Set to 0
for unlimited.
Maximum number of conversations that can be auto-assigned to an agent, conversations in
"Resolved" or "Closed" states do not count toward this limit. Set to 0 for unlimited.
</FormDescription>
<FormMessage />
</FormItem>
@@ -97,6 +96,7 @@
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem :value = 0>None</SelectItem>
<SelectItem v-for="bh in businessHours" :key="bh.id" :value="bh.id">
{{ bh.name }}
</SelectItem>
@@ -121,6 +121,7 @@
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem :value= 0>None</SelectItem>
<SelectItem
v-for="sla in slaStore.options"
:key="sla.value"
@@ -226,7 +227,11 @@ const fetchBusinessHours = async () => {
}
const onSubmit = form.handleSubmit((values) => {
props.submitForm(values)
props.submitForm({
...values,
business_hours_id: values.business_hours_id > 0 ? values.business_hours_id : null,
sla_policy_id: values.sla_policy_id > 0 ? values.sla_policy_id: null
})
})
watch(

View File

@@ -1,16 +1,18 @@
import { format, differenceInMinutes, differenceInHours, differenceInDays, differenceInYears } from 'date-fns'
import { format, differenceInMinutes, differenceInHours, differenceInDays, differenceInMonths, differenceInYears } from 'date-fns'
export function getRelativeTime (timestamp, now = new Date()) {
try {
const mins = differenceInMinutes(now, timestamp)
const hours = differenceInHours(now, timestamp)
const days = differenceInDays(now, timestamp)
const months = differenceInMonths(now, timestamp)
const years = differenceInYears(now, timestamp)
if (mins === 0) return 'now'
if (mins < 60) return `${mins}m`
if (hours < 24) return `${hours}h`
if (days < 365) return `${days}d`
if (days < 31) return `${days}d`
if (months < 12) return `${months}mo`
return `${years}y`
} catch (error) {
console.error('Error parsing time', error, 'timestamp', timestamp)