/*
* Copyright 2023 Anyware Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This class is the model for versions displayed in the versions drop down of the compare tool
* @private
*/
Ext.define("Ametys.plugins.cms.content.compare.CompareContentVersionTool.CompareContentVersion", {
extend: 'Ext.data.Model',
fields: [
{name: 'value', type: 'string'},
{name: 'label', type: 'string' },
{name: 'listLabel', type: 'string', calculate: function(data) { return "{{i18n PLUGINS_CMS_COMPARE_CONTENT_VERSIONS_TOOL_VERSION_TEXT_1}} " + data.label + " {{i18n PLUGINS_CMS_COMPARE_CONTENT_VERSIONS_TOOL_VERSION_TEXT_2}} " + Ext.Date.format(data.date, Ext.Date.patterns.VeryShortTime); }},
{name: 'fullLabel', type: 'string', calculate: function(data) { return "{{i18n PLUGINS_CMS_COMPARE_CONTENT_VERSIONS_TOOL_VERSION_LIST_1}} " + data.label + " {{i18n PLUGINS_CMS_COMPARE_CONTENT_VERSIONS_TOOL_VERSION_LIST_2}} " + Ext.Date.format(data.date, Ext.Date.patterns.ShortDateTime); }},
{name: 'date', type: 'date'},
{name: 'day', type: 'string', calculate: function(data) { return Ext.Date.format(data.date, Ext.Date.patterns.FullDate); }}
]
});