Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: DateTime Field Extension

  1. #1
    Sencha Premium Member glopes's Avatar
    Join Date
    Jan 2013
    Location
    Chicago
    Posts
    123
    Vote Rating
    31
      1  

    Lightbulb DateTime Field Extension

    Hi guys,


    I created a simple DateTime Field User Extension that I would like to share with you. This might be useful for someone who needs to work with Dates and Times and would like to avoid using Date Field and Time Field.

    Here is the github repository in case you wanna clone from there and help fix bugs (feel free to create pull requests): https://github.com/gportela85/DateTimeField

    UPDATE (Jun 22nd, 2015): Added compatibility with ExtJS 4.2.x, ExtJS 5.x and ExtJS 6
    Fixed many bugs

    Thanks,
    Attached Files Attached Files

  2. #2
    Sencha Premium User lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 千葉
    Posts
    666
    Vote Rating
    20
      0  

    Default

    Cool!
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!
    ================================================
    And here are my terms...

    1. I don't care if you use my source code. (Known as "Code.")
    2. I don't care if I get any monetary compensation.
    3. I do care to receive credit for Code provided. So, please keep my name in the comments for Code provided.
    4. Code is provided without warranty "AS-IS" and I claim absolutely no warranty nor liability to the quality, security, and run-ability on any platform.
    5. By using Code, you accept all risk inherit with Code regardless if Code has known and yet to be discovered bugs.
    6. You are welcome to change and improve the Code to best meet your needs.
    7. I don't care if you use the Code in a commercial or open-source project.
    8. You are not required to contact me prior to using the Code.

    ================================================
    Simple. Enjoy.

  3. #3
    Sencha Premium Member glopes's Avatar
    Join Date
    Jan 2013
    Location
    Chicago
    Posts
    123
    Vote Rating
    31
      1  

    Default

    I modified the logic a little bit so different DateTime formats like 'c' would work too.

    New .aux version and screenshots available on GitHub.

  4. #4
    Sencha Premium Member glopes's Avatar
    Join Date
    Jan 2013
    Location
    Chicago
    Posts
    123
    Vote Rating
    31
      1  

    Default

    I have added support for ExtJS 5.0 and Sencha Architect 3.1. (Attached file to my first post has been replaced with the new version)

  5. #5
    Sencha User
    Join Date
    Jul 2012
    Posts
    321
    Vote Rating
    31
      0  

    Default

    hey, thanks so much for sharing this! I just wanted to add a note here: users will need to rename the download from DateTimeField.aux.zip to DateTimeField.aux in order to install this into Architect properly. OSX users take note: you may need to use Terminal to rename it instead of Finder, as Finder sometimes will just hide the extension visually, but keep it on the filesystem!
    Steve Sobel
    @honestbleeps
    Sencha Architect Development Team

  6. #6
    Sencha Premium Member glopes's Avatar
    Join Date
    Jan 2013
    Location
    Chicago
    Posts
    123
    Vote Rating
    31
      1  

    Default

    Honestbleeps, thanks for adding this tip. I took this time now to upload the latest version here, that adds support to use the DateTimeField inside grid editors and fixed some bugs.

  7. #7
    Sencha User
    Join Date
    Jul 2008
    Posts
    6
    Vote Rating
    0
      0  

    Default problem with slider...

    the slider does not appear... I'm using Extjs 5.1.0... i don't know if i using this plugin wrong, but i'm only add de .js files in ext/src/ux/ folder, including the required files in my extjs form ... it's the correct way? seems that slider still there, but's not appear...

  8. #8
    Sencha Premium Member glopes's Avatar
    Join Date
    Jan 2013
    Location
    Chicago
    Posts
    123
    Vote Rating
    31
      0  

    Default

    One way is to add your files like this:

    Code:
    <link rel="stylesheet" href="../../Libraries/ext-5.1.0/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css" /> <script src="../../Libraries/ext-5.1.0/build/ext-all.js"></script> <script src="DateTimePicker.js"></script> <script src="DateTimeField.js"></script>
    <script src="app.js"></script>
    This should be enought to display the field when you add

    Code:
    Ext.application({
        name: 'DateTimeField',
        launch : function() {
            Ext.create('Ext.form.Panel',{
                title: 'Testing',
                border: false,
                bodyPadding: 10,
                width: 300,
                height: 300,
                items: [{
                    xtype: 'datetimefield',
                    fieldLabel : 'Label',
                    format : 'm/d/Y H:i'
                }],
                renderTo: Ext.getBody()
            })
        }
    });
    I've added a fiddle with ExtJS 5.1:

  9. #9
    Sencha User
    Join Date
    Jul 2008
    Posts
    6
    Vote Rating
    0
      0  

    Default ohh man... i'm sorry

    something is wrong with my project... i've added a simple slider field in my form, and the slider not appear... i don't know if some problem occurs in my project, but I created the project again with sencha cmd, put all files in the project and the slider appears... BUT, the previous theme is crisp, and my actual (after create project again) theme is neptune... but in your example, the slider works fine... ... well, I think the problem must be me.


    Sorry about that, and sorry about my english


    Thanks in advance

  10. #10
    Sencha User
    Join Date
    Jul 2008
    Posts
    6
    Vote Rating
    0
      0  

    Default

    oh, and thank you, your plugin solve my problem!

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •