!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/rtail-expressjs/node_modules/chrono-node/test/en/   drwxr-xr-x
Free 12.91 GB of 57.97 GB (22.27%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     en_example.test.js (2.09 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
var chrono = require('../../src/chrono');



test("Test - Custom parser example", function() {


    var christmasParser = new chrono.Parser();

    // Provide search pattern
    christmasParser.pattern = function () { return /Christmas/i } 

    // This function will be called when matched pattern is found
    christmasParser.extract = function(text, ref, match, opt) { 
        
        // Return a parsed result, that is 25 December
        return new chrono.ParsedResult({
            ref: ref,
            text: match[0],
            index: match.index,
            start: {    
                day: 25, 
                month: 12, 
            }
        });
    }

    var custom = new chrono.Chrono();
    custom.parsers.push(christmasParser);

    var resultDate = custom.parseDate("I'll arrive at 2.30AM on Christmas night", new Date(2013, 11, 10))
    var expectDate = new Date(2013, 12-1, 25, 2, 30, 0);
    expect(expectDate.getTime()).toBeCloseTo(resultDate.getTime())
    
});


test("Test - Custom refiner example", function() {


    var guessPMRefiner = new chrono.Refiner();

    // If there is no AM/PM specified, all time between 1:00 - 4:00 will be guessed as PM (13.00 - 16.00)
    guessPMRefiner.refine = function(text, results, opt) {

        results.forEach(function (result) {

            if (!result.start.isCertain('meridiem') 
                &&  result.start.get('hour') >= 1 && result.start.get('hour') < 4) {

                result.start.assign('meridiem', 1);
                result.start.assign('hour', result.start.get('hour') + 12);
            }
        });

        return results;
    } 

    var custom = new chrono.Chrono();
    custom.refiners.push(guessPMRefiner);

    var resultDate = custom.parseDate("This is at 2.30", new Date(2013, 11, 10))
    var expectDate = new Date(2013, 12-1, 10, 14, 30, 0);
    expect(expectDate.getTime()).toBeCloseTo(resultDate.getTime())
    

    var resultDate = custom.parseDate("This is at 2.30 AM", new Date(2013, 11, 10))
    var expectDate = new Date(2013, 12-1, 10, 2, 30, 0);
    expect(expectDate.getTime()).toBeCloseTo(resultDate.getTime())
    
});


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0324 ]--