Giter Club home page Giter Club logo

acf-field-date-time-picker's Introduction

ACF Date and Time Picker Field

Adds a 'Date and Time Picker' field type for the Advanced Custom Fields WordPress plugin.


Works with ACF 4.2.0

Overview

This is an add-on for the Advanced Custom Fields WordPress plugin, that allows you to add a Date and Time Picker field type.

Compatibility

This add-on will work with:

  • Advanced Custom Fields version 4 and up
  • Advanced Custom Fields version 3 and bellow

Installation

This add-on can be treated as both a WP plugin and a theme include.

Install as Plugin

  1. Copy the 'acf-date_time_picker' folder into your plugins folder
  2. Activate the plugin via the Plugins admin page

Include within theme

  1. Copy the 'acf-date_time_picker' folder into your theme folder (can use sub folders). You can place the folder anywhere inside the 'wp-content' directory
  2. Edit your functions.php file and add the code below (Make sure the path is correct to include the acf-date_time_picker.php file)
add_action('acf/register_fields', 'my_register_fields');

function my_register_fields()
{
	include_once('acf-date_time_picker/acf-date_time_picker.php');
}

Frequently Asked Questions

How do I set the date and time format?

To set the date and time format when you create the field, you have to create a string using the letters below.

Date format

	d    day of month (no leading zero)
	dd   day of month (two digit)
	o    day of the year (no leading zeros)
	oo   day of the year (three digit)
	D    day name short
	DD   day name long
	m    month of year (no leading zero)
	mm   month of year (two digit)
	M    month name short
	MM   month name long
	y    year (two digit)
	yy   year (four digit)

Time format

	H    Hour with no leading 0 (24 hour)
	HH   Hour with leading 0 (24 hour)
	h    Hour with no leading 0 (12 hour)
	hh   Hour with leading 0 (12 hour)
	m    Minute with no leading 0
	mm   Minute with leading 0
	s    Second with no leading 0
	ss   Second with leading 0
	l    Milliseconds always with leading 0
	t    a or p for AM/PM
	T    A or P for AM/PM
	tt   am or pm for AM/PM
	TT   AM or PM for AM/PM

Examples

  • yy-mm-dd: 2013-04-12
  • HH:mm: 24 hour clock, with a leading 0 for hour and minute
  • h:m tt: 12 hour clock with am/pm, no leading 0

More Information

http://soderlind.no/time-picker-field-for-advanced-custom-fields/

acf-field-date-time-picker's People

Contributors

imjohnbon avatar soderlind avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.