Stream - Show Date and Time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • redgular
    Member
    • Feb 2016
    • 36

    Stream - Show Date and Time

    What file can I change so that the Date and Time show on the Stream. (Today and Past stream).
    I do see that client/src/views/fields/datetime-short.js has an affect on the date and time I'm just not sure on how to change it.

    Example.

    Apr 6 - 10:00am
    Attached Files
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello
    client/src/views/stream/note.js
    change view parameter in createField from datetime-short to datetime

    this.createField('createdAt', null, null, 'views/fields/datetime');

    Comment

    • Sloff
      Member
      • Feb 2018
      • 47

      #3
      Hi tanya

      Is there an upgrade safe way to do this? Or is this the best way to do it?

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        Hi, you could try
        open application/Espo/Resources/metadata/clientDefs/Note.json . You can see itemViews key. In custom clientDefs of Note you can set the view for each type of
        • Create;
        • EmailReceived;
        • CreateRelated;
        • Update;
        • Status;
        • Post;
        • EmailSent;
        • Assign;
        • Relate.
        and override init method

        Comment

        • Sloff
          Member
          • Feb 2018
          • 47

          #5
          Thank you!

          Comment

          • khopper
            Senior Member
            • Sep 2017
            • 329

            #6
            I can't seem to get this to work within the custom directories after a rebuild.
            I have copied the file note.js from the source and modified datetime-short to datetime and placed in /client/custom/src/views/stream/
            post.js was place in /client/custom/src/views/stream/notes/ and also modified to Espo.define('Custom:views/stream/notes/post', ......
            Am I missing a step?

            Comment

            • tanya
              Senior Member
              • Jun 2014
              • 4308

              #7
              Did you set your view in custom/Espo/Custom/Resources/metadata/clientDefs/Note.json

              Comment


              • khopper
                khopper commented
                Editing a comment
                Yes I did - not sure if I did it properly though.

                {
                "itemViews": {
                "Post": "views/stream/notes/post"
                }
                }
                Last edited by khopper; 08-16-2018, 02:12 PM.
            • tanya
              Senior Member
              • Jun 2014
              • 4308

              #8
              Espo.define('custom:views/stream/notes/post', ......?

              Comment

              • khopper
                Senior Member
                • Sep 2017
                • 329

                #9
                Here is what I have for all 3 files, I rebuilt the backend with no errors and still showing the short version.
                I also cleared all my local cache and refreshed the page.
                Current version: 5.3.6

                /custom/Espo/Custom/Resources/metadata/clientDefs/note.json
                Code:
                {
                  "itemViews": {
                    "Post": "views/stream/notes/post"
                  }
                }
                /client/custom/src/views/stream/note.js
                Code:
                Espo.define('custom:views/stream/note', 'view', function (Dep) {....
                Code:
                this.createField('createdAt', null, null, 'views/fields/datetime');
                /client/custom/src/views/stream/notes/post.js
                Code:
                Espo.define('custom:views/stream/notes/post', 'views/stream/note', function (Dep) {....
                Last edited by khopper; 08-17-2018, 03:08 AM.

                Comment

                • tanya
                  Senior Member
                  • Jun 2014
                  • 4308

                  #10
                  in clientDefs you don't call your view, but default
                  your vie has the name
                  custom:views/stream/notes/post

                  Comment


                  • khopper
                    khopper commented
                    Editing a comment
                    I had tried that before, I updated as suggested and still showing short view after doing a rebuild.

                    /custom/Espo/Custom/Resources/metadata/clientDefs/note.json
                    Code:
                    "Post": "custom:views/stream/notes/post"
                • tanya
                  Senior Member
                  • Jun 2014
                  • 4308

                  #11
                  /note.json?
                  in lower case?
                  check data/cache/application/metadata.php
                  can you find your clientDefs customization here? if not - path or content is not correct

                  Comment


                  • khopper
                    khopper commented
                    Editing a comment
                    The "N" Is actually upper case and has been in "Note.json" my typo. Should it be lowercase?
                    /custom/Espo/Custom/Resources/metadata/clientDefs/Note.json

                    This was listed in the metadata.php file
                    'itemViews' =>
                    array (
                    'Post' => 'custom:views/stream/notes/post',
                • tanya
                  Senior Member
                  • Jun 2014
                  • 4308

                  #12
                  If it is in cached metadata - everything is ok here.
                  Attach content of /client/custom/src/views/stream/notes/post.js

                  Comment

                  • khopper
                    Senior Member
                    • Sep 2017
                    • 329

                    #13
                    Attached are the 3 files from the following locations.

                    /custom/Espo/Custom/Resources/metadata/clientDefs/Note.json
                    /client/custom/src/views/stream/note.js
                    /client/custom/src/views/stream/notes/post.js
                    Attached Files

                    Comment

                    • tanya
                      Senior Member
                      • Jun 2014
                      • 4308

                      #14
                      you create /client/custom/src/views/stream/note.js but you nowhere use it...
                      Espo.define('custom:views/stream/notes/post', 'custom:views/stream/note', function (Dep) {

                      Comment

                      • khopper
                        Senior Member
                        • Sep 2017
                        • 329

                        #15
                        Thank you, I was going off the above recommendations and the customization documentation.

                        I updated /client/custom/src/views/stream/note.js
                        to the following and it began working.
                        Espo.define('custom:views/stream/notes/post', 'custom:views/stream/note', function (Dep) {
                        Attached Files

                        Comment

                        Working...