# Post Toolbar Options - Timestamp?

**URL:** <https://meta.discourse.org/t/post-toolbar-options-timestamp/51853>\
**Category:** Feature\
**Created:** [21. Oktober 2016 um 12:42 UTC](https://meta.discourse.org/t/post-toolbar-options-timestamp/51853 "2016-10-21T12:42:30Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)\
**Post date:** [20. Dezember 2016 um 23:21 UTC](https://meta.discourse.org/t/post-toolbar-options-timestamp/51853/6 "2016-12-20T23:21:41Z")

</div>

Just a quick question to re-open this if I may…

I spotted that when this was being used the time stamp was quite long, looking at the various options using JavaScript to shorten the date it seemed incredibly complex, from what I could tell the desired output would always be 21 characters long so went with a bit of a hacky way of doing this…

```
<script type="text/discourse-plugin" version="0.4">
    api.onToolbarCreate(toolbar => {
      toolbar.addButton({
        id: "updated_button",
        group: "extras",
        icon: "clock-o",
        perform: e => e.addText("_Updated " + new Date().toString().substring(0,21) + "_")
      });
    });
</script>

```

I then spotted that the hover text didn’t display a name correctly - so we have added this

`title: "Updated Timestamp",`

thus;

```
<script type="text/discourse-plugin" version="0.4">
    api.onToolbarCreate(toolbar => {
      toolbar.addButton({
        id: "updated_button",
        group: "extras",
        icon: "clock-o",
        title: "Updated Timestamp",
        perform: e => e.addText("_Updated " + new Date().toString().substring(0,21) + "_")
      });
    });
</script>

```

but the output in the hover text appears as `[en.Updated Timestamp]`

Anyway to remove the square brackets and the `en.` part?

---

_[View the full topic](https://meta.discourse.org/t/post-toolbar-options-timestamp/51853)._
