티스토리 뷰

Programming/JavaScript, Sencha

Sencha dateformat

파란크리스마스 2012. 7. 3. 01:35
728x90

출처 :
http://stackoverflow.com/questions/10496912/convert-date-from-json-format-to-other-formats-in-sencha
http://stackoverflow.com/questions/7848369/sencha-touch-date-format

소스

  Ext.regModel('dataModel', {
      fields: [
         {name: 'id', type: 'int'},
         {name: 'vod_id', type: 'int'},
         {name: 'comment', type: 'string'},
         {name: 'regid', type: 'string'},
         {name: 'regdate', type:'date', dateFormat: 'c'}
      ]
  });

  dataList = new Ext.List({
      title: 'VodComment목록',
      store: dataStore,
      scroll: false,
      layout:'fit',
      blockRefresh:true,
      itemTpl:'{comment} {regid} / {regdate:date("Y.m.d H:i:s")}'
  });

패턴

Date.patterns = {
    ISO8601Long : "Y-m-d H:i:s",
    ISO8601Short : "Y-m-d",
    ShortDate : "n/j/Y",
    LongDate : "l, F d, Y",
    FullDateTime : "l, F d, Y g:i:s A",
    MonthDay : "F d",
    ShortTime : "g:i A",
    LongTime : "g:i:s A",
    SortableDateTime : "Y-m-d\\TH:i:s",
    UniversalSortableDateTime : "Y-m-d H:i:sO",
    YearMonth : "F, Y"
};
댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함