Stream Pro - Full Datetime in stream

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kharg
    Senior Member
    • Jun 2021
    • 500

    #1

    Stream Pro - Full Datetime in stream

    Hello,

    I wrote a small extension to replace the datetime-short with just datetime in the stream as I always hated not seeing the full datetime and editing the original note.js is not upgrade safe.
    It works by replacing the text with the text shown by hovering the mouse, so it's upgrade safe.
    I tested it on various instances with different post types, it works on every version from 6.0 up to 7.2.
    Let me know what do you think if you try it!

    https://github.com/Kharg/stream-pro/releases
    Last edited by Kharg; 02-25-2023, 02:13 PM.
  • Kharg
    Senior Member
    • Jun 2021
    • 500

    #2
    Updated to 2.2.5 with custom setting to expand stream updates and an option to enable/disable the full datetime.
    Click image for larger version  Name:	image.png Views:	0 Size:	15.7 KB ID:	88323​​
    Full Time and Date for EspoCRM Stream Notes. Contribute to Kharg/stream-pro development by creating an account on GitHub.
    Last edited by Kharg; 02-21-2023, 05:54 AM.

    Comment

    • esforim
      Active Community Member
      • Jan 2020
      • 2227

      #3
      For the curious:

      Setting location: /#Admin/StreamPro
      Click image for larger version  Name:	image.png Views:	0 Size:	7.0 KB ID:	88435

      After install. Before install it doesn't show the Time, only date.

      Click image for larger version  Name:	image.png Views:	0 Size:	2.8 KB ID:	88436

      If you enable the "Stream Expand". This is quite cool, in v6 I manually add this feature but ever since v7 I didn't want to go find the guide/tutorial to do it again. Finally I can add this back easily thanks to Kharg. Basically it auto open the "down arrow".

      Another interesting thing is he manage to do a "Force" refresh all page/tab once you save the setting. I remember a thread of someone asking how it can be done (maybe it him!), whoever you are, look through this extension to learn how-to.
      Click image for larger version  Name:	image.png Views:	0 Size:	6.7 KB ID:	88437
      Last edited by esforim; 02-24-2023, 03:59 AM.

      Comment

      • Kharg
        Senior Member
        • Jun 2021
        • 500

        #4
        Thank you for your comment esforim
        It is using this function to refresh all the tabs

        PHP Code:
                broadcastUpdate: function () {
                    this.getHelper().broadcastChannel.postMessage('reload');
                }

        Comment

        • khopper
          Senior Member
          • Sep 2017
          • 343

          #5
          Does this work on version 8.2.2?

          Comment


          • Kharg
            Kharg commented
            Editing a comment
            yes, it does.
        • bandtank
          Active Community Member
          • Mar 2017
          • 413

          #6
          This module installs itself into the wrong locations. The files should be in custom/Espo/Modules and client/custom/modules, but the files are installed in application/Espo/Modules and client/modules. Reference
          Last edited by bandtank; 08-28-2025, 02:07 PM.

          Comment


          • Kharg
            Kharg commented
            Editing a comment
            Yes, I need to update it.

            It was built when that was still the only location for extensions
        • crmclients
          Senior Member
          • Jul 2020
          • 340

          #7
          Originally posted by Kharg
          Yes, I need to update it.

          It was built when that was still the only location for extensions
          Click image for larger version

Name:	image.png
Views:	0
Size:	7.5 KB
ID:	126143

          I love this! Installed in my local EspoCRM in WIndows, wish I could install in the Cloud!
          Great work!

          Comment

          • Kharg
            Senior Member
            • Jun 2021
            • 500

            #8
            Originally posted by crmclients

            Click image for larger version  Name:	image.png Views:	0 Size:	7.5 KB ID:	126143

            I love this! Installed in my local EspoCRM in WIndows, wish I could install in the Cloud!
            Great work!
            You can use this in the cloud version with a small trick, a Tampermonkey/Greasemonkey script, however this will only be applied in your browser, other users would have to do the same.
            HTML Code:
            // ==UserScript==
            // @name         EspoCRM Stream Pro (Full Datetime)
            // @namespace    https://github.com/Kharg/stream-pro
            // @version      1.0.0
            // @description  Replace short relative datetime in EspoCRM stream notes with the full datetime from the title attribute. Tampermonkey port of stream-pro.
            // @author       Kharg
            // @match        *://your-espocrm-domain.tld/*
            // @grant        none
            // @run-at       document-idle
            // ==/UserScript==
            
            (function () {
                'use strict';
            
                // Mirrors the original extension's selector exactly:
                // $("div.stream-date-container a span").text(function() { return $(this).attr('title'); });
                const SELECTOR = 'div.stream-date-container a span[title]';
            
                // Marker so we don't reprocess the same node on every mutation tick.
                const FLAG = 'data-stream-pro-applied';
            
                function apply(span) {
                    const full = span.getAttribute('title');
                    if (!full) return;
                    if (span.getAttribute(FLAG) === full) return; // already applied for this title value
                    if (span.textContent !== full) {
                        span.textContent = full;
                    }
                    span.setAttribute(FLAG, full);
                }
            
                function scan(root) {
                    const scope = (root && root.querySelectorAll) ? root : document;
                    scope.querySelectorAll(SELECTOR).forEach(apply);
                }
            
                scan(document);
            
                // Espo renders stream items asynchronously (initial load, infinite scroll, view re-renders,
                // and periodic title refresh as relative time ticks). One observer covers all of it.
                const observer = new MutationObserver((mutations) => {
                    for (const m of mutations) {
                        if (m.type === 'childList') {
                            for (const node of m.addedNodes) {
                                if (node.nodeType !== 1) continue;
                                if (node.matches && node.matches(SELECTOR)) {
                                    apply(node);
                                } else {
                                    scan(node);
                                }
                            }
                        } else if (m.type === 'attributes' && m.attributeName === 'title') {
                            const t = m.target;
                            if (t.matches && t.matches(SELECTOR)) {
                                apply(t);
                            }
                        }
                    }
                });
            
                observer.observe(document.body, {
                    childList: true,
                    subtree: true,
                    attributes: true,
                    attributeFilter: ['title']
                });
            })();

            Comment


            • crmclients
              crmclients commented
              Editing a comment
              Thanks so much Kharg! I have a client in finance and Today never works if they have to look at the calendar to get the date Not aware of Tamper... but will be fun to try it!

            • Kharg
              Kharg commented
              Editing a comment
              It's super easy, you just need a browser extension and this script and you are set
          Working...