Skip to content

Commit

Permalink
Merge pull request #7 from gravityview/develop
Browse files Browse the repository at this point in the history
Version 2.1
  • Loading branch information
zackkatz authored Jun 26, 2018
2 parents b36524c + f1c50d1 commit ef784b0
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 32 deletions.
25 changes: 1 addition & 24 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,8 @@ module.exports = function(grunt) {
},
},

dirs: {
lang: 'languages'
},

// Convert the .po files to .mo files
potomo: {
dist: {
options: {
poDel: false
},
files: [{
expand: true,
cwd: '<%= dirs.lang %>',
src: ['*.po'],
dest: '<%= dirs.lang %>',
ext: '.mo',
nonull: true
}]
}
},

// Pull in the latest translations
exec: {
transifex: 'tx pull -a',

// Create a ZIP file
zip: 'python /usr/bin/git-archive-all ../gravity-forms-business-hours.zip'
}
Expand All @@ -85,6 +62,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-exec');


grunt.registerTask( 'default', ['uglify','exec:transifex','potomo','wp_readme_to_markdown','watch'] );
grunt.registerTask( 'default', ['uglify','wp_readme_to_markdown','watch'] );

};
2 changes: 1 addition & 1 deletion class-gf-business-hours.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class GFBusinessHours extends GFAddOn {

protected $_version = "2.0";
protected $_version = "2.1";
protected $_min_gravityforms_version = "2.0";
protected $_slug = 'gravity-forms-business-hours';
protected $_path = 'gravity-forms-business-hours/gravity-forms-business-hours.php';
Expand Down
25 changes: 22 additions & 3 deletions class-gf-field-business-hours.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ class GF_Field_Business_Hours extends GF_Field {

public $type = 'business_hours';

public $inputType = 'select';

public function __construct( array $data = array() ) {
parent::__construct( $data );

// Default label
$this->label = __('Business Hours', 'gravity-forms-business-hours');
parent::__construct( $data );

$this->add_hooks();
}
Expand All @@ -31,6 +31,25 @@ private function add_hooks() {
add_filter( 'gravityforms_business_hours_output_template', 'gravityview_strip_whitespace' );
}

add_action( 'gform_editor_js_set_default_values', array( $this, 'js_set_default_values' ) );

}

/**
* Set default label to "Business Hours"
*
* @since 2.1
*
* @return void
*/
function js_set_default_values() {
?>
case "<?php echo $this->type; ?>" :
field.label = <?php echo json_encode( esc_html__( 'Business Hours', 'gravity-forms-business-hours' ) ); ?>;
field.inputs = null;
field.clockType = '12';
break;
<?php
}

/**
Expand Down
2 changes: 1 addition & 1 deletion gravity-forms-business-hours.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Gravity Forms Business Hours by GravityView
Plugin URI: https://gravityview.co
Description: Add a Business Hours field to your Gravity Forms form. Brought to you by <a href="https://gravityview.co">GravityView</a>, the best plugin for displaying Gravity Forms entries.
Version: 2.0.1
Version: 2.1
Author: GravityView
Author URI: https://gravityview.co
Text Domain: gravity-forms-business-hours
Expand Down
2 changes: 1 addition & 1 deletion helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function gf_business_hours_get_times( $with_after_midnight = false ) {
* Modify the time format for the displayed value
* @param string
*/
$value_format = apply_filters( 'gravityforms_business_hours_time_format', 'g:i a' );
$value_format = apply_filters( 'gravityforms_business_hours_time_format', get_option( 'time_format' ) );

$starttime = '00:00';
$time = new DateTime( $starttime );
Expand Down
14 changes: 13 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Gravity Forms Business Hours by GravityView #
**Tags:** gravityview,gravity forms, gravity,gravity form,business, hours, time, field, form
**Requires at least:** 3.3
**Tested up to:** 4.9
**Tested up to:** 4.9.6
**Stable tag:** trunk
**Contributors:** katzwebdesign,katzwebservices,gravityview
**License:** GPL 3 or higher
Expand All @@ -11,6 +11,8 @@ Add a Business Hours field to Gravity Forms.

## Description ##

> This plugin requires [Gravity Forms](https://rocketgenius.pxf.io/c/1210629/445235/7938), the best form plugin for Wordpress!
Add a Business Hours field to your Gravity Forms form.

__This plugin supports:__
Expand Down Expand Up @@ -58,6 +60,16 @@ These filters are available for code writers to modify the output:

## Changelog ##

### 2.1 on June 25, 2018 ###

* Updated: Use site's time format setting for the time dropdowns (24-hour clock now supported)
* Fixed: Not able to update the field's default label

### 2.0.1 on February 26, 2018 ###

* Fixed: Network Activation on Multisite
* Moved `GFBusinessHours` class to its own file

### 2.0 on November 8, 2017 ###

* Email notifications now show a list of hours instead of code
Expand Down
9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=== Gravity Forms Business Hours by GravityView ===
Tags: gravityview,gravity forms, gravity,gravity form,business, hours, time, field, form
Requires at least: 3.3
Tested up to: 4.9.4
Tested up to: 4.9.6
Stable tag: trunk
Contributors: katzwebdesign,katzwebservices,gravityview
License: GPL 3 or higher
Expand All @@ -11,6 +11,8 @@ Add a Business Hours field to Gravity Forms.

== Description ==

> This plugin requires [Gravity Forms](https://rocketgenius.pxf.io/c/1210629/445235/7938), the best form plugin for Wordpress!

Add a Business Hours field to your Gravity Forms form.

__This plugin supports:__
Expand Down Expand Up @@ -52,6 +54,11 @@ These filters are available for code writers to modify the output:

== Changelog ==

= 2.1 on June 25, 2018 =

* Updated: Use site's time format setting for the time dropdowns (24-hour clock now supported)
* Fixed: Not able to update the field's default label

= 2.0.1 on February 26, 2018 =

* Fixed: Network Activation on Multisite
Expand Down

0 comments on commit ef784b0

Please sign in to comment.