We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48387
    • 2 Posts
    Hello( Why date input not work properly?
    I tried to specify a default value to "now" and "today". I tried use another TV field (when I open resource with this TV I see current date, but if I open migx with this TV - value is 1970-01-01 00:00:00)
    How I can get worked default value whith date input in MIGX?
      • 48387
      • 2 Posts
      My CMP config
      {
        "formtabs":[
          {
            "MIGX_id":1,
            "caption":"\u041e\u0442\u0437\u044b\u0432",
            "print_before_tabs":"0",
            "fields":[
              {
                "MIGX_id":45,
                "field":"created",
                "caption":"\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f",
                "description":"",
                "description_is_code":"0",
                "inputTV":"",
                "inputTVtype":"date",
                "validation":"",
                "configs":"",
                "restrictive_condition":"",
                "display":"",
                "sourceFrom":"config",
                "sources":"",
                "inputOptionValues":"",
                "default":"now",
                "useDefaultIfEmpty":1,
                "pos":1
              },
              {
                "MIGX_id":3,
                "field":"tags",
                "caption":"\u0422\u0435\u0433\u0438",
                "description":"\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0433\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e",
                "description_is_code":"0",
                "inputTV":"",
                "inputTVtype":"",
                "validation":"",
                "configs":"",
                "restrictive_condition":"",
                "display":"",
                "sourceFrom":"config",
                "sources":"",
                "inputOptionValues":"",
                "default":"",
                "useDefaultIfEmpty":"0",
                "pos":2
              },
              {
                "MIGX_id":2,
                "field":"text",
                "caption":"\u0422\u0435\u043a\u0441\u0442 \u043e\u0442\u0437\u044b\u0432\u0430",
                "description":"",
                "description_is_code":"0",
                "inputTV":"",
                "inputTVtype":"richtext",
                "validation":"",
                "configs":"",
                "restrictive_condition":"",
                "display":"",
                "sourceFrom":"config",
                "sources":"",
                "inputOptionValues":"",
                "default":"",
                "useDefaultIfEmpty":"0",
                "pos":3
              },
              {
                "MIGX_id":6,
                "field":"file",
                "caption":"\u0421\u043a\u0430\u043d \u043e\u0442\u0437\u044b\u0432\u0430",
                "description":"",
                "description_is_code":"0",
                "inputTV":"image",
                "inputTVtype":"",
                "validation":"",
                "configs":"",
                "restrictive_condition":"",
                "display":"",
                "sourceFrom":"config",
                "sources":"",
                "inputOptionValues":"",
                "default":"",
                "useDefaultIfEmpty":"0",
                "pos":4
              }
            ],
            "pos":1
          },
          {
            "MIGX_id":11,
            "caption":"\u041a\u043b\u0438\u0435\u043d\u0442",
            "print_before_tabs":"0",
            "fields":[
              {
                "MIGX_id":41,
                "field":"user_fields",
                "caption":"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f",
                "description":"",
                "description_is_code":"0",
                "inputTV":"_migx_params",
                "inputTVtype":"",
                "validation":"",
                "configs":"",
                "restrictive_condition":"",
                "display":"",
                "sourceFrom":"config",
                "sources":"",
                "inputOptionValues":"",
                "default":"",
                "useDefaultIfEmpty":"0",
                "pos":1
              }
            ],
            "pos":2
          },
          {
            "MIGX_id":9,
            "caption":"\u0412\u0440\u0430\u0447\/\u041e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435",
            "print_before_tabs":"0",
            "fields":[
              {
                "MIGX_id":38,
                "field":"department_id",
                "caption":"\u041e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435",
                "description":"",
                "description_is_code":"0",
                "inputTV":"",
                "inputTVtype":"listbox-multiple",
                "validation":"",
                "configs":"",
                "restrictive_condition":"",
                "display":"",
                "sourceFrom":"config",
                "sources":"",
                "inputOptionValues":"@SELECT `pagetitle` AS `name`,`id` FROM `modx_site_content` WHERE `parent` = 1 AND `deleted` = 0 AND `published` = 1",
                "default":"",
                "useDefaultIfEmpty":"0",
                "pos":1
              },
              {
                "MIGX_id":39,
                "field":"doctor_id",
                "caption":"\u0414\u043e\u043a\u0442\u043e\u0440",
                "description":"",
                "description_is_code":"0",
                "inputTV":"",
                "inputTVtype":"listbox-multiple",
                "validation":"",
                "configs":"",
                "restrictive_condition":"",
                "display":"",
                "sourceFrom":"config",
                "sources":"",
                "inputOptionValues":"@SELECT `pagetitle` AS `name`,`id` FROM `modx_site_content` WHERE `parent` = 10 AND `deleted` = 0 AND `published` = 1",
                "default":"",
                "useDefaultIfEmpty":"0",
                "pos":2
              }
            ],
            "pos":3
          },
          {
            "MIGX_id":10,
            "caption":"\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432\u0440\u0430\u0447\u0430\/\u043a\u043b\u0438\u043d\u0438\u043a\u0438",
            "print_before_tabs":"0",
            "fields":[
              {
                "MIGX_id":40,
                "field":"comment",
                "caption":"\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a\u043b\u0438\u043d\u0438\u043a\u0438",
                "description":"",
                "description_is_code":"0",
                "inputTV":"",
                "inputTVtype":"richtext",
                "validation":"",
                "configs":"",
                "restrictive_condition":"",
                "display":"",
                "sourceFrom":"config",
                "sources":"",
                "inputOptionValues":"",
                "default":"",
                "useDefaultIfEmpty":"0",
                "pos":1
              }
            ],
            "pos":4
          }
        ],
        "contextmenus":"update||duplicate||publish||unpublish||activate||deactivate||remove",
        "actionbuttons":"addItem||bulk||toggletrash||emptyThrash",
        "columnbuttons":"update||duplicate||publish||unpublish||activate||deactivate||remove",
        "filters":"",
        "extended":{
          "migx_add":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0437\u044b\u0432",
          "disable_add_item":"",
          "add_items_directly":"",
          "formcaption":"\u041e\u0442\u0437\u044b\u0432\u044b",
          "update_win_title":"\u0414\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u0437\u044b\u0432\u0430",
          "win_id":"",
          "maxRecords":"",
          "addNewItemAt":"bottom",
          "multiple_formtabs":"",
          "multiple_formtabs_label":"",
          "multiple_formtabs_field":"",
          "multiple_formtabs_optionstext":"",
          "multiple_formtabs_optionsvalue":"",
          "actionbuttonsperrow":4,
          "winbuttonslist":"",
          "extrahandlers":"",
          "filtersperrow":4,
          "packageName":"reviews",
          "classname":"modReview",
          "task":"",
          "getlistsort":"published",
          "getlistsortdir":"asc",
          "sortconfig":"",
          "gridpagesize":50,
          "use_custom_prefix":"0",
          "prefix":"",
          "grid":"",
          "gridload_mode":1,
          "check_resid":1,
          "check_resid_TV":"",
          "join_alias":"",
          "has_jointable":"yes",
          "getlistwhere":"",
          "joins":"",
          "hooksnippets":"",
          "cmpmaincaption":"\u041e\u0442\u0437\u044b\u0432\u044b",
          "cmptabcaption":"\u0421\u043f\u0438\u0441\u043e\u043a \u043e\u0442\u0437\u044b\u0432\u043e\u0432",
          "cmptabdescription":"\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0442\u0437\u044b\u0432\u043e\u0432.",
          "cmptabcontroller":"",
          "winbuttons":"",
          "onsubmitsuccess":"",
          "submitparams":""
        },
        "columns":[
          {
            "MIGX_id":5,
            "header":"ID",
            "dataIndex":"id",
            "width":30,
            "sortable":true,
            "show_in_grid":1,
            "customrenderer":"",
            "renderer":"",
            "clickaction":"",
            "selectorconfig":"",
            "renderchunktpl":"",
            "renderoptions":"",
            "editor":""
          },
          {
            "MIGX_id":1,
            "header":"\u0422\u0435\u0433\u0438",
            "dataIndex":"tags",
            "width":"",
            "sortable":"false",
            "show_in_grid":1,
            "customrenderer":"",
            "renderer":"",
            "clickaction":"",
            "selectorconfig":"",
            "renderchunktpl":"",
            "renderoptions":"",
            "editor":""
          },
          {
            "MIGX_id":2,
            "header":"\u041e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435",
            "dataIndex":"department_id",
            "width":"",
            "sortable":"false",
            "show_in_grid":1,
            "customrenderer":"",
            "renderer":"this.renderChunk",
            "clickaction":"",
            "selectorconfig":"",
            "renderchunktpl":"[[!pdoResources?\n    &limit=`0`\n    &deleted=`0`\n    &published=`1`\n    &where=`{ \"id:in\": [[list2json?input=`[[+department_id]]`]] }`\n    &tpl=`@INLINE <span style=\"font-size: 12px; background-color: #e1dbe4; border-radius: 3px; padding: 3px 5px; margin: 0 4px 3px 0\">[[+pagetitle]]<\/span>`\n]]",
            "renderoptions":"",
            "editor":""
          },
          {
            "MIGX_id":3,
            "header":"\u0412\u0440\u0430\u0447",
            "dataIndex":"doctor_id",
            "width":"",
            "sortable":"false",
            "show_in_grid":1,
            "customrenderer":"",
            "renderer":"this.renderChunk",
            "clickaction":"",
            "selectorconfig":"",
            "renderchunktpl":"[[!pdoResources?\n    &limit=`0`\n    &deleted=`0`\n    &published=`1`\n    &where=`{ \"id:in\": [[list2json?input=`[[+doctor_id]]`]] }`\n    &tpl=`@INLINE <span style=\"font-size: 12px; background-color: #E4E4E4; border-radius: 3px; padding: 3px 5px; margin: 0 4px 3px 0\">[[+pagetitle]]<\/span>`\n]]",
            "renderoptions":"",
            "editor":""
          },
          {
            "MIGX_id":4,
            "header":"\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d",
            "dataIndex":"published",
            "width":30,
            "sortable":true,
            "show_in_grid":1,
            "customrenderer":"",
            "renderer":"this.renderClickCrossTick",
            "clickaction":"",
            "selectorconfig":"",
            "renderchunktpl":"",
            "renderoptions":"",
            "editor":""
          }
        ]
      }