# Live Topic Timer

**URL:** https://meta.discourse.org/t/live-topic-timer/129917
**Category:** Theme component
**Tags:** topic-timers
**Created:** [October 1, 2019, 7:39am UTC](https://meta.discourse.org/t/live-topic-timer/129917 "2019-10-01T07:39:03Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [October 1, 2019, 7:39am UTC](https://meta.discourse.org/t/live-topic-timer/129917/1 "2019-10-01T07:39:03Z")

</div>

This theme component changes the default `timed` topic timer to a live countdown timer.

![29%20PM](https://global.discourse-cdn.com/meta/original/3X/4/d/4da317c0df143ba9aacc1301d5aef3245c697327.png)

* * *

## Repository Link

[https://github.com/paviliondev/live-topic-timer](https://github.com/paviliondev/live-topic-timer)

* * *

- The `rerender time` can be changed in the component settings according to your use case.

- The time displayed by the timer can be format in multiple ways from the theme component setting whose documentation can be found [here](https://github.com/jsmreese/moment-duration-format#template).

 ![43%20PM](https://global.discourse-cdn.com/meta/original/3X/0/9/09c1041947a78537385cfcafb48db66f79c7b4d8.png)

## To do

- Display the timer on the header next to the topic title.  
I’m looking for specific UI/UX suggestions for how to implement a header timer, in the context of Discourse, with a view to crowd-funding the development costs if there’s enough interest (@darhazer @tobiaseigen)

* * *

## Installation

> [@Installing a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682):
>
> bookmark This is a guide for installing and managing themes and theme components in Discourse. person_raising_hand Required user level: Administrator Installing and customizing themes can significantly improve the look and feel of your Discourse site. You can easily import and manage themes and their components through the Discourse admin panel. This guide covers: Importing new themes and theme components Adding theme components to a theme Managing automatic updates Additional resourc…

---

<div class="post-metadata">

### Author: ![Anatolia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/anatolia/32/133777_2.png) [@Anatolia](https://meta.discourse.org/u/Anatolia)
#### Post date: [December 28, 2019, 2:30pm UTC](https://meta.discourse.org/t/live-topic-timer/129917/2 "2019-12-28T14:30:35Z")

</div>

This doesn’t work since a few days. Can you look at it?

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [December 28, 2019, 10:24pm UTC](https://meta.discourse.org/t/live-topic-timer/129917/3 "2019-12-28T22:24:23Z")

</div>

Yes, I’m aware of the fact that some of the code I overrode is changed in core discourse. I’ll take a look at this around mid next week.

cc @angus, @Ellibereth, @darhazer

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [January 5, 2020, 7:52pm UTC](https://meta.discourse.org/t/live-topic-timer/129917/4 "2020-01-05T19:52:22Z")

</div>

[https://github.com/paviliondev/live-topic-timer/commit/d82e717cd54f15900e4f5b9cd0bb80304a9b7078](https://github.com/paviliondev/live-topic-timer/commit/d82e717cd54f15900e4f5b9cd0bb80304a9b7078)

Just pushed an update to the component to fix compatibility with latest discourse.

---

<div class="post-metadata">

### Author: ![ninjapenguin](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@ninjapenguin](https://meta.discourse.org/u/ninjapenguin)
#### Post date: [January 20, 2020, 12:54pm UTC](https://meta.discourse.org/t/live-topic-timer/129917/5 "2020-01-20T12:54:44Z")

</div>

can this be set on specific categories? i could see this being very useful in combination with the voting plugin.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [January 20, 2020, 12:56pm UTC](https://meta.discourse.org/t/live-topic-timer/129917/6 "2020-01-20T12:56:14Z")

</div>

Currently, it works for all timed topics. @ninjapenguin if you’re are willing to fund the development of this feature, I’ll be happy to add the category specific feature for the component.

In any case, you can join the discussion related to the component here.

> **[Pavilion](https://pavilion.tech/)**
>
> Pavilion is the leading Discourse consultancy.

---

<div class="post-metadata">

### Author: ![ninjapenguin](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@ninjapenguin](https://meta.discourse.org/u/ninjapenguin)
#### Post date: [January 20, 2020, 2:17pm UTC](https://meta.discourse.org/t/live-topic-timer/129917/7 "2020-01-20T14:17:45Z")

</div>

i don’t think we need it enough. more a ‘nice to have’ in our use case than a core feature we’d use often. it looks great though, well done.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [May 7, 2020, 7:49pm UTC](https://meta.discourse.org/t/live-topic-timer/129917/8 "2020-05-07T19:49:48Z")

</div>

This theme component is breaking the topic timers interface, unfortunately. Number of days seems to turn into number of seconds, and the blue bar containing the “Replies on this topic are automatically deleted after ..” has no next. It then becomes impossible to remove timer. Deleting this theme component made it work again.

 ![Screen Shot 2020-05-07 at 11.12.32 AM](https://global.discourse-cdn.com/meta/original/3X/c/d/cd08969f1324e4e204488bce6021dd1b20109d07.png)

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [May 7, 2020, 8:29pm UTC](https://meta.discourse.org/t/live-topic-timer/129917/9 "2020-05-07T20:29:33Z")

</div>

It needs to be dusted again. I’ll come to this one in the next week. Thanks for reporting. Makes a strong case for bookmark reminders for me.

---

<div class="post-metadata">

### Author: ![CaptainZac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/captainzac/32/195184_2.png) [@CaptainZac](https://meta.discourse.org/u/CaptainZac)
#### Post date: [March 24, 2021, 11:39am UTC](https://meta.discourse.org/t/live-topic-timer/129917/10 "2021-03-24T11:39:40Z")

</div>

> [@Topic Will Close A Few Seconds After The Last Reply](https://meta.discourse.org/t/topic-will-close-a-few-seconds-after-the-last-reply/184225):
>
> 2.7.0 Beta 5 all members on the community experience this bug On our site, the topic time is set to 3 months and it says a few seconds instead. It works correctly and closes in 3 months, but it should say “3 months”

Bug with this theme.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [March 24, 2021, 11:49am UTC](https://meta.discourse.org/t/live-topic-timer/129917/11 "2021-03-24T11:49:08Z")

</div>

I’ve been meaning to come to this for some time. I’ll take a look on friday.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [March 25, 2021, 6:34am UTC](https://meta.discourse.org/t/live-topic-timer/129917/12 "2021-03-25T06:34:29Z")

</div>

> [@tobiaseigen](#):
>
> This theme component is breaking the topic timers interface, unfortunately. Number of days seems to turn into number of seconds, and the blue bar containing the “Replies on this topic are automatically deleted after …” has no next.

> [@CaptainZac](#):
>
> Bug with this theme.

I can repro this. Sorry for not coming to this earlier.

The theme component was never tested with timers other than the `close topic timer`, as it was built for that timer, but the name suggests that it should work for all sorts of topic timers.

Also, it shouldn’t have affected any other default functionality atleast. I’m working on fixing this and will get back with a solution soon.

This was my first piece of client work on discourse. Brings back old memories.

p.s.

I’ve made a PR to the core Topic Timer to make it extensible for plugin/theme devs. Overriding the monolith method can be quite prone to breakage.

[https://github.com/discourse/discourse/pull/12519](https://github.com/discourse/discourse/pull/12519)  
cc @martin

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [March 25, 2021, 11:12pm UTC](https://meta.discourse.org/t/live-topic-timer/129917/13 "2021-03-25T23:12:32Z")

</div>

Thanks for the fix, I merged it into core now 👍

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 26, 2021, 12:17am UTC](https://meta.discourse.org/t/live-topic-timer/129917/14 "2021-03-26T00:17:49Z")

</div>

Slightly off topic, but worth noting for the future:

`DEV:` prefix means this is a dev related refactor, we do not need anything in the release notes.

`FIX:` means bug fix which we want to possibly call out in the release notes

`FEATURE:` means new feature (or feature removal) which we want to possibly call out in the release notes

`IMPR:` is a bit odd, we do not use that prefix anywhere..

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [March 26, 2021, 12:50am UTC](https://meta.discourse.org/t/live-topic-timer/129917/15 "2021-03-26T00:50:33Z")

</div>

> [@sam](#):
>
> `IMPR:` is a bit odd, we do not use that prefix anywhere…

Its bad memory from my side. I wrongly remember a post by Jeff which explain these terms but I can imagine IMPR not being one of them. I’ll keep that in mind.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [March 26, 2021, 4:30am UTC](https://meta.discourse.org/t/live-topic-timer/129917/16 "2021-03-26T04:30:24Z")

</div>

The good news is, the code is now more extensible and maintainable from a dev standpoint after the merge. I’ll try and fix the component in the coming week.

Thanks @sam for the tip and @martin for the merge.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [March 29, 2021, 8:39pm UTC](https://meta.discourse.org/t/live-topic-timer/129917/17 "2021-03-29T20:39:11Z")

</div>

This should be resolved if you update the theme component and discourse both to latest tests-passed.

Moreover, it should now support all the other timers too. Happy to fix any issues if they arise.
