Giter Site home page Giter Site logo

cakephp-timezone's Introduction

CakePHP Timezone Helper Plugin

Generates a user-friendly dropdown which is based on a users Country and current time.

screen

Installation

[Manual]

[GIT Submodule]

In your app directory type:

git submodule add -b master git://github.com/robmcvey/cakephp-timezone.git Plugin/Timezone
git submodule init
git submodule update

[GIT Clone]

In your Plugin directory type:

git clone -b master git://github.com/robmcvey/cakephp-timezone.git Timezone

Usage

Remember to add CakePlugin::load('Timezone'); to your app's bootstrap file.

Then add the helper to any of your controllers using;

public $helpers = array('Timezone.Timezone');

In your view, you can then show a timezone select from within a form. E.g.

<?php 
echo $this->Form->create('Post');
	echo $this->Timezone->select('timezone');
echo $this->Form->end(__('Submit'));

Generated markup

<optgroup label="United Kingdom">
	<option value="Europe/London">GMT +1:00 (12:01pm)</option>
</optgroup>
<optgroup label="United States">
	<option value="Pacific/Honolulu">GMT -10:00 (1:01am)</option>
	<option value="America/New_York">GMT -4:00 (7:01am)</option>
	<option value="America/North_Dakota/New_Salem">GMT -5:00 (6:01am)</option>
	<option value="America/Shiprock">GMT -6:00 (5:01am)</option>
	<option value="America/Phoenix">GMT -7:00 (4:01am)</option>
	<option value="America/Yakutat">GMT -8:00 (3:01am)</option>
	<option value="America/Adak">GMT -9:00 (2:01am)</option>
</optgroup>
<optgroup label="United States Minor Outlying Islands">
	<option value="Pacific/Wake">GMT +12:00 (23:01pm)</option>
	<option value="Pacific/Johnston">GMT -10:00 (1:01am)</option>
	<option value="Pacific/Midway">GMT -11:00 (0:01am)</option>
</optgroup>

cakephp-timezone's People

Contributors

robmcvey avatar amcorreia avatar josegonzalez avatar

Watchers

James Cloos 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.