Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    28
    Vote Rating
    0
    dmayer is on a distinguished road

      0  

    Default Remove Day of the Week from Date Picker

    Remove Day of the Week from Date Picker


    How do I remove the day of the week from the output of the date picker?

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    What do you mean "the output"? Do you mean remove it from the UI?

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    28
    Vote Rating
    0
    dmayer is on a distinguished road

      0  

    Default


    I have added a column that uses the date editor. I have the date editor set with the following values:

    editor: new yg.DateEditor({format: 'MM/dd/yyyy', minValue: '01/01/06'})

    Once the date picker appears, I select a date (e.g. 10/04/2006) and the grid shows the date formatted just like above. However once I tab off the cell the date format changes to Thu Oct 05 2006 00:00:00 GMT-0400 (Eastern Daylight Time). How do I set the grid so the date reflects the format set above?

  4. #4
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    There's an editor and a renderer, both are defined independently. Renders handle formating values in cells (when not in editing mode) and obviously editors are for editing.

    Here's the JS file for the editor grid example:

    http://www.jackslocum.com/blog/examp...tor-example.js

    There is a function defined in the local scope:

    Code:
    var formatDate = function(value){
         return value.dateFormat('M d, Y');  
    };
    Add the column definition looks like this:

    Code:
    {
       header: "Available",
       width: 95, 
       renderer: formatDate, 
       editor: new yg.DateEditor({
                   format: 'm/d/y', 
                   minValue: '01/01/06', 
                   disabledDays: [0, 6], 
                   disabledDaysText: 'Plants are not available on the weekends', 
                   disabledDates : ['^07', '04/15', '12/02/06'],
                   disabledDatesText : 'The plants are pollinating on %0, choose a different date.'})
    }
    Notice the renderer config option. This defines the function to call to provide custom formatting of the cells value.

    Both date formats could be the same, in the example I just wanted to show they didn't have to be.

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    28
    Vote Rating
    0
    dmayer is on a distinguished road

      0  

    Default formatDate dependencies

    formatDate dependencies


    Jack,

    Thanks for the help. I started using the formatDate code listed above in my grid but I am getting a javascript error saying ""value.dateFormat is not a function". I am including the date-util.js script in my web page.

    Here is the code from my page:

    Code:
    <html>
    <head>
    <title>GTD - Denis Mayer</title>
    <link>
    <style>
    
    #editor-grid .ygrid-col-3{
    
        text-align:right;
    
    }
    
    </style><link>	
    <script></script>
    <script></script>
    <script></script>
    <script></script>
    <script></script>
    </head>
    <body>
    
    
    Tasks</p>
    <div></div>
    
    
    <script></script>
    
    </body>
    </html>
    Am I missing anything?[/code]

  6. #6
    Ext User
    Join Date
    Mar 2007
    Posts
    28
    Vote Rating
    0
    dmayer is on a distinguished road

      0  

    Default Need to add a line to formatDate

    Need to add a line to formatDate


    Jack,

    I found the problem. The formatDate function needs an additional line in order to work correctly:

    Original formatDate Code:
    Code:
        var formatDate = function(value){
            return value.dateFormat('M d, Y');  
        };
    New Code
    Code:
        var formatDate = function(value){
        	var d = new Date(value);  
            return d.dateFormat('m/d/Y');  
        };
    When I ran the original code I was getting a javascript error saying that "dateFormat doesnt exist". By declaring a date variable set to value parameter the issue goes away.

    [/code]

  7. #7
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    The forum seems to have stripped all your code.

    You don't need to include the date-util.js script, there is a small library included by default in yutil.js, which is part of yui-ext-core.js (and in yui-ext.js too if you are including everything).

    How are you loading your data? Is it from an array, an XMLDataModel, ... ? The "dateFormat" function is defined on all Date objects. My guess is that it the internal data isn't a date object. For example, if you are using XML, you should parse the date using a preprocessor function. This way it's sorted, edited and rendered from the same date object instead of being parsed repetitively. Since you are using an editor, it's also logical that you would like changes reflected in your XML document. This is where you can provide a postProcessor function to convert the date back to a string before it is stored back in the XML file.

    If you look at the script in the link I included in my last message, it is doing just that:

    Code:
    var parseDate = function(value){
        return new Date(Date.parse(value));  
    };
    ...
    dataModel.addPreprocessor(3, parseDate);
    A post processor would be the same, only in reverse:

    Code:
    var formatXmlDate = function(value){
        return value.format('m/d/y'); 
    };
    ...
    dataModel.addPostprocessor(3, formatXmlDate);
    Manually doing this is kind of a pain and in a future version it would make sense to introduce data types that do this for you automatically.

  8. #8
    Ext User
    Join Date
    Mar 2007
    Posts
    28
    Vote Rating
    0
    dmayer is on a distinguished road

      0  

    Default


    I am using PHP, MySQL and the yahoo-ext grid.

    The grid is calling a php file to get the rows in JSON format. So naturally, I'm using the JSONDataModel to load the grid.

    When I do that, the dates are coming back as strings which is why I'm casting them to a date.

  9. #9
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    Same thing with the JSONDataModel, add the preprocessor function some you don't parse them every time you do something with it.

Similar Threads

  1. Date Picker
    By zquirm in forum Ext 1.x: Help & Discussion
    Replies: 11
    Last Post: 16 Mar 2008, 6:38 AM
  2. DateEditor date picker and disabledDates
    By jamaljohnson in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 25 Jan 2007, 6:45 PM
  3. date picker
    By pomata in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 10 Dec 2006, 12:11 PM
  4. Color picker editor for yui-ext
    By rodiniz in forum Community Discussion
    Replies: 10
    Last Post: 25 Nov 2006, 8:22 PM

Thread Participants: 1