Ignore:
Timestamp:
03/05/10 13:36:50 (2 years ago)
Author:
dar
Message:

Ajout de l'aspect IAccessRightsAspect sur NuxeoSrcNode, field srcLiveUri, libellé des onglets de versions, format des colonnes de dates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Xul_Commons/modules/scenariCommons/widgets/jsTree/cellBuilders.jsm

    r14883 r15040  
    4141 
    4242Components.utils.import("resource://scenariCommons/commons/basis.jsm"); 
     43Components.utils.import("resource://scenariCommons/commons/i18n.jsm"); 
    4344Components.utils.import("resource://scenariCommons/widgets/jsTree/jsTree.jsm"); 
    4445 
     
    185186 * la propriété nommée pDataKey des rows. 
    186187 */ 
    187 function CellBuilderLeafDate(pDataKey, pSortable){ 
     188function CellBuilderLeafDate(pDataKey, pSortable, pFormat){ 
    188189        this.fDataKey = pDataKey; 
    189190        if(pSortable) this.fSortable = true; 
     191        if(pFormat) this.fFormat = pFormat; 
    190192} 
    191193CellBuilderLeafDate.prototype.__proto__ = CellBuilderBase.prototype; 
    192194CellBuilderLeafDate.prototype.getCellText = function(pJsTreeRow, pCol) { 
    193195        if(!pJsTreeRow || pJsTreeRow.fCh) return ""; 
    194         return new Date(pJsTreeRow.fDatas[pJsTreeRow.getIdxColumn(this.fDataKey)]).toLocaleString(); 
     196        var vDate = new Date(pJsTreeRow.fDatas[pJsTreeRow.getIdxColumn(this.fDataKey)]); 
     197        if (this.fFormat) { 
     198                function pad(n) { return n<10 ? '0'+n : n; }; 
     199                var vFullYear = vDate.getFullYear(); 
     200                var vLocaleDate = i18n.formatStr(this.fFormat, 
     201                        vFullYear, 
     202                        pad(vDate.getMonth()), 
     203                        pad(vDate.getDate()), 
     204                        pad(vDate.getHours()), 
     205                        pad(vDate.getMinutes()), 
     206                        pad(vDate.getSeconds()), 
     207                        pad(vFullYear % 100) 
     208                ); 
     209                return vLocaleDate; 
     210        } else return vDate.toLocaleString(); 
    195211} 
    196212CellBuilderLeafDate.prototype.cycleHeader = CellBuilderLeafString.prototype.cycleHeader; 
Note: See TracChangeset for help on using the changeset viewer.