承接 scottconnerly/timezone 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

scottconnerly/timezone

最新稳定版本:v0.2

Composer 安装命令:

composer require scottconnerly/timezone

包简介

Bringing Ruby on Rails' time zone list to PHP.

关键字:

README 文档

README

Creating a time zone select in PHP can get unruly quickly, as DateTimeZone::listIdentifiers() returns over 415 Zones and Links. This is an attempt to take a page from Ruby on Rails' ActiveSupport::TimeZone time_zone_select(), largely by using their curated list of about 150 Zones, and also by allowing for 'priority_zones' to be at the top of the list.

Screenshot of timezone select

Example:

echo TimeZoneSelect::get_select(['country'=>'US']);

Simple demo avaiable: http://scott.connerly.net/TimeZone/example.php

Available args w/ default values:

[
    'country'        => '',          //ISO-3116 2-letter country code
    'priority_zones' => [],          //If you want to specify a list of zones that aren't country-specific
    'priority_label' => 'Regional',  //The label of the optgroup for the priority zones

    'selected'       => '',          //which option is selected
    
    'name'           => 'time_zone', //name for the <select>
    'class'          => '',          //class for the <select>
    'id'             => '',          //id for the <select>
    'data'           => [],          //list of data attributes to add to the <select>
]
  • This repo involves occasionally scraping the rails repo. Here is the ticket asking Rails to make their data file more easily accessible: rails/rails#22088
  • It would be much easier if there was a similarly curated list inside of PHP. Here's the request to them for that: https://bugs.php.net/bug.php?id=70801

统计信息

  • 总下载量: 7.64k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 33
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 32
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-only
  • 更新时间: 2015-10-30