Plugin Directory

Changeset 2115264


Ignore:
Timestamp:
07/01/2019 08:18:14 AM (7 years ago)
Author:
codeheaven
Message:

valid & invalid result check issue fixed

Location:
em-purchase-code-validator
Files:
82 added
4 edited

Legend:

Unmodified
Added
Removed
  • em-purchase-code-validator/trunk/README.md

    r2045154 r2115264  
    77Author:            CodeHeaven 
    88Requires at least: 4.9 
    9 Tested up to:      5.1
    10 Stable tag:        1.0.1
    11 Version:           1.0.1
     9Tested up to:      5.1 
     10Stable tag:        1.0.
     11Version:           1.0.
    1212
    1313This is a simple plugin to validate your customer purchase code from Envato Market.
     
    3636== Changelog ==
    3737
     38= 1.0.3 =
     39* Fixed: valid & invalid result check issue fixed
     40
    3841= 1.0.2 =
    3942* Fixed: issue with date in moment js fixed
  • em-purchase-code-validator/trunk/README.txt

    r2045154 r2115264  
    88Requires at least: 4.9
    99Tested up to:      5.1
    10 Stable tag:        1.0.2
    11 Version:           1.0.2
     10Stable tag:        1.0.3
     11Version:           1.0.3
    1212
    1313This is a simple plugin to validate your customer purchase code from Envato Market.
     
    3535== Changelog ==
    3636
     37= 1.0.3 =
     38* Fixed: valid & invalid result check issue fixed
     39
    3740= 1.0.2 =
    3841* Fixed: issue with date in moment js fixed
  • em-purchase-code-validator/trunk/em-puchase-code-validator.php

    r2045154 r2115264  
    1717 * Plugin URI:        https://wordpress.org
    1818 * Description:       This is a simple plugin to validate your customer purchase code from Envato Market.
    19  * Version:           1.0.2
     19 * Version:           1.0.3
    2020 * Author:            CodeHeaven
    2121 * Author URI:        https://codeheavenbd.com
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'EM_PURCHASE_CODE_VALIDATOR', '1.0.2' );
     38define( 'EM_PURCHASE_CODE_VALIDATOR', '1.0.3' );
    3939
    4040/**
  • em-purchase-code-validator/trunk/public/assets/js/em-puchase-code-validator-public.js

    r2045154 r2115264  
    1616    methods: {
    1717        getValidity : function ( supportDate ) {
    18             if ( moment(supportDate).isSame(moment(), 'day') ) {
     18            var splitedDate = supportDate.split(' ');
     19
     20            if ( splitedDate[0] == 'January' ) {
     21                splitedDate[0] = 01;
     22            } else if( splitedDate[0] == 'February' ) {
     23                splitedDate[0] = 02;
     24            } else if( splitedDate[0] == 'March' ) {
     25                splitedDate[0] = 03;
     26            } else if( splitedDate[0] == 'April' ) {
     27                splitedDate[0] = 04;
     28            } else if( splitedDate[0] == 'May' ) {
     29                splitedDate[0] = 05;
     30            } else if( splitedDate[0] == 'June' ) {
     31                splitedDate[0] = 06;
     32            } else if( splitedDate[0] == 'July' ) {
     33                splitedDate[0] = 07;
     34            } else if( splitedDate[0] == 'August' ) {
     35                splitedDate[0] = 08;
     36            } else if( splitedDate[0] == 'September' ) {
     37                splitedDate[0] = 09;
     38            } else if( splitedDate[0] == 'October' ) {
     39                splitedDate[0] = 10;
     40            } else if( splitedDate[0] == 'November' ) {
     41                splitedDate[0] = 11;
     42            } else if( splitedDate[0] == 'December' ) {
     43                splitedDate[0] = 12;
     44            }
     45
     46            var formatedDate = splitedDate[2] + '-' +  splitedDate[0] + '-' + splitedDate[1].slice(0,-2);
     47            console.log( formatedDate );
     48            var date = moment(formatedDate);
     49            var now = moment();
     50            if ( now > date ) {
     51                this.validClass = false;
    1952                this.invalidClass = true;
    2053                return 'Invalid for support';
    2154            } else {
     55                this.invalidClass = false;
    2256                this.validClass = true;
    2357                return 'Valid for support';
Note: See TracChangeset for help on using the changeset viewer.