Download the PHP package matotominac/time-traveler without Composer

On this page you can find all versions of the php package matotominac/time-traveler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package time-traveler

Time Traveler plugin for Craft CMS 3.x

Allow users to change the time zone.

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

To install the plugin either install it through Plugin Store or tell Composer to load the plugin and then go to Settings → Plugins and click the “Install” button for Time Traveler.

    composer require matotominac/time-traveler

Time Traveler Overview

With Time Traveler plugin users will be able to select a timezone for their user account. When they select a timezone all dates will instantly be shown in their selected time zone, no need for any extra frontend conversion. Also everything they post that includes time will be posted in their time zone and propery converted to system's time zone.

When you enable the plugin all timezones will be available in the dropdown but you are in total control of selecting which timezones will show and you can also rename timezones to something nicer than default PHP timezone labels.

Configuring Time Traveler

Create a file called time-traveler.php in your Craft's config folder and paste the following code.

timezoneList option has the form '[php time zone name]' => '[label]'. List of all PHP time zones can be found here.

Two sample config files for US and Australian time zones are included in plugin's root folder, you can directly copy them to your Craft's config folder. Please do not forget to rename them to time-traveler.php.

User timezone selection instructions

To allow users to select timezone follow these steps:

  1. Create a new field of type TimeZone (this field type will be available when you enable the plugin). Plugin requires this field's handle to be set to timeZone but if you wish to have something different you will have to update the value of the option fieldName in your time-traveler.php config file (as shown in the snippet above).

  1. Add this newly created field to user's profile.

  1. That's all. Now every user is allowed to select custom timezone. Timezone for the user will be changed for both frontend site and Craft admin, as long as the user is logged in.

FAQs

Will this plugin work on already developed sites or are there any twig modifications necessary?

Yes, this plugin will work on any already existing site. All you need to do is enable the plugin, add the field to user's profile as described below and that's it, plugin will work out of the box, even on existing sites. No modifications are necesary in twig code for showing dates on frontend.

Can I add the time zone selection field to frontend user profile edit form?

Absolutely. Time zone selection field is a field like any other custom field on user profile. Simply add the dropdown field with list of timezones and name it fields[timeZone] (or replace timeZone in case you renamed the field as shown above).

Can I allow unregistered users to select a time zone?

Unfortunately not yet but that feature is on our roadmap.

Time Traveler Roadmap


All versions of time-traveler with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^3.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package matotominac/time-traveler contains the following files

Loading the files please wait ....