Announcement

Collapse
No announcement yet.

Stream - Show Date and Time

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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


    • #3
      Hi tanya

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

      Comment


      • #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


        • #5
          Thank you!

          Comment


          • #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


            • #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.

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

              Comment


              • #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


                • #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"

                • #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',

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

                  Comment


                  • #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


                    • #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


                      • #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...
                        X