All Projects → fpg1503 → Caterpillar

fpg1503 / Caterpillar

Licence: MIT license
🐛 Caterpillar: Type-safe date formats in Swift, no more "yyyy-MM-dd'T'HH:mm:ssZ"

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Caterpillar

format-date
📆 A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.
Stars: ✭ 25 (-48.98%)
Mutual labels:  date, date-format, date-formatting
dayjs
Extended fork of Day.js - 2KB immutable date library alternative to Moment.js
Stars: ✭ 36 (-26.53%)
Mutual labels:  date, date-formatting
go-prettytime
Format GoLang dates in a “pretty” way. ex : just now, a minute ago, 2 hours ago , 3 minutes ago
Stars: ✭ 23 (-53.06%)
Mutual labels:  date, date-formatting
vue-date-fns
Date filter for Vue based on the date-fns.
Stars: ✭ 21 (-57.14%)
Mutual labels:  date, date-formatting
date-php
这是一个Javascript模仿PHP日期时间格式化函数,使用方法和PHP非常类似,有丰富的模板字符,并在原来的基础上增加了一些模板字符。 This is a date function that implement PHP in Javascript. It is very similar to PHP, has rich template characters, and enhances some template characters on the basis of the original.
Stars: ✭ 24 (-51.02%)
Mutual labels:  date, date-format
Swiftdate
🐔 Toolkit to parse, validate, manipulate, compare and display dates, time & timezones in Swift.
Stars: ✭ 6,661 (+13493.88%)
Mutual labels:  date, date-formatting
Dayjs
⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
Stars: ✭ 37,373 (+76171.43%)
Mutual labels:  date, date-formatting
Time
Building a better date/time library for Swift
Stars: ✭ 1,983 (+3946.94%)
Mutual labels:  date, date-formatting
elm-date-extra
Extra functions for working with Date
Stars: ✭ 41 (-16.33%)
Mutual labels:  date, date-format
cassidy
Cassidy programming language, bringing static typing, strictness, safety and precision into your web project
Stars: ✭ 25 (-48.98%)
Mutual labels:  type-safe
jquery-date-dropdowns
A simple, customisable jQuery datepicker plugin to dynamically generate separate "day", "month" and "year" dropdowns, and provide a formatted date string for form submission
Stars: ✭ 42 (-14.29%)
Mutual labels:  date
swift-package-manager-ios
Example of how to use SPM v4 to manage iOS dependencies
Stars: ✭ 136 (+177.55%)
Mutual labels:  swift-package-manager
rn-date-range
date picker component for react native
Stars: ✭ 16 (-67.35%)
Mutual labels:  date
ConsoleUI
Rasterize SwiftUI views to images from macOS terminal
Stars: ✭ 52 (+6.12%)
Mutual labels:  swift-package-manager
SAFE.Simplified
A lightweight alternative template of SAFE for happy cross-IDE full-stack F# development
Stars: ✭ 97 (+97.96%)
Mutual labels:  type-safe
tir
Have time.ir in shell!
Stars: ✭ 114 (+132.65%)
Mutual labels:  date
BJOTPViewController
Entering OTP made simpler.
Stars: ✭ 42 (-14.29%)
Mutual labels:  swift-package-manager
remote memory
A simple library which provides a way to read and write the memory of other processes
Stars: ✭ 40 (-18.37%)
Mutual labels:  type-safe
SwiftFCXRefresh
Pull to refresh in Swift.
Stars: ✭ 29 (-40.82%)
Mutual labels:  swift-package-manager
current-date
The current date, nothing else
Stars: ✭ 14 (-71.43%)
Mutual labels:  date

Caterpillar

Platforms License

Swift Package Manager Carthage compatible CocoaPods compatible

Travis Cookiecutter-Swift

🐛 Caterpillar: Type-safe date formats in Swift, no more "yyyy-MM-dd'T'HH:mm:ssZ"

Requirements

  • iOS 8.0+ / Mac OS X 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 8.0+

Usage

Simply create a Caterpillar using Caterpillar() or 🐛(), add the desired components and set it in your DateFormatter:

let format = 🐛()
    .year(.fourDigits)
    .separator(.dash)
    .month(.zeroPaddedNumber)
    .separator(.dash)
    .day(.zeroPaddedNumber)
    .string("T")
    .hour(.zeroPaddedTwentyFourHour)
    .separator(.colon)
    .minute(.zeroPaddedNumber)
    .separator(.colon)
    .second(.zeroPaddedNumber)
    .timezone(.RFC822)

let formatter = DateFormatter()
formatter.setDateFormat(format)

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build Caterpillar 1.0.0+.

To integrate Caterpillar into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Caterpillar', '~> 1.0.0'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Caterpillar into your Xcode project using Carthage, specify it in your Cartfile:

github "Caterpillar/Caterpillar" ~> 1.0.0

Swift Package Manager

To use Caterpillar as a Swift Package Manager package just add the following in your Package.swift file.

import PackageDescription

let package = Package(
    name: "HelloCaterpillar",
    dependencies: [
        .Package(url: "https://github.com/fpg1503/Caterpillar.git", "1.0.0")
    ]
)

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate Caterpillar into your project manually.

Git Submodules

  • Open up Terminal, cd into your top-level project directory, and run the following command "if" your project is not initialized as a git repository:
$ git init
  • Add Caterpillar as a git submodule by running the following command:
$ git submodule add https://github.com/fpg1503/Caterpillar.git
$ git submodule update --init --recursive
  • Open the new Caterpillar folder, and drag the Caterpillar.xcodeproj into the Project Navigator of your application's Xcode project.

    It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.

  • Select the Caterpillar.xcodeproj in the Project Navigator and verify the deployment target matches that of your application target.

  • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.

  • In the tab bar at the top of that window, open the "General" panel.

  • Click on the + button under the "Embedded Binaries" section.

  • You will see two different Caterpillar.xcodeproj folders each with two different versions of the Caterpillar.framework nested inside a Products folder.

    It does not matter which Products folder you choose from.

  • Select the Caterpillar.framework.

  • And that's it!

The Caterpillar.framework is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.

Embeded Binaries

  • Download the latest release from https://github.com/fpg1503/Caterpillar/releases
  • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.
  • In the tab bar at the top of that window, open the "General" panel.
  • Click on the + button under the "Embedded Binaries" section.
  • Add the downloaded Caterpillar.framework.
  • And that's it!

Acknowledgments

License

Caterpillar is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].