Giter Site home page Giter Site logo

sparkar-dateformat's Introduction

sparkar-dateformat

Patch script for date formatting for Spark AR Studio.

Screenshot

Install

Click here to download the zip file, extract it and import dateformat.js as an asset for your Spark AR project.

Usage

Below are the patch inputs/outputs you have to define for the script.

From Script

date

  • Description: Formatted date you receive from the script.
  • Type: Text

To Script

format

  • Description: Set in which format pattern the date text will be generated.
  • Type: Text
  • Optional: true
  • Default: 'YYYY-MM-DD HH:mm:ss'

Patterns

Input Example Description
YYYY 2021 4 digit year.
YY 21 2 digit year.
MM 02 Month number from 01 to 12 (with leading zero).
M 2 Month number from 1 to 12.
DD 09 Day of month from 01 to 31 (with leading zero).
D 9 Day of month from 1 to 31.
HH 06 Hours (24 hour time) from 00 to 23 (with leading zero).
H 6 Hours (24 hour time) from 0 to 23.
hh 03 Hours (12 hour time) from 01 to 12 (with leading zero).
h 3 Hours (12 hour time) from 1 to 12.
mm 04 Minutes from 00 to 59 (with leading zero).
m 4 Minutes from 0 to 59.
ss 07 Seconds from 00 to 59 (with leading zero).
s 7 Seconds from 0 to 59.
A PM Post or ante meridiem in uppercase.
a am Post or ante meridiem in lowercase.

refreshInterval

  • Description: Interval in seconds in which the date text will be refreshed.
  • Type: Number
  • Optional: true
  • Default: 1

debug

  • Description: Display debug messages on console.
  • Type: Boolean
  • Optional: true
  • Default: false

Credits

  • Josh Beckwith for making spark-localtime, which inspired me to create this script. I originally planned to contribute to his repo, but since his script relied on the toLocaleDateString method and it doesn't seen to work on Spark AR Studio anymore, I just made my own script from scratch;
  • Taynara Lima for creating Instagram filters, which made me see the limitations of Spark AR Studio in relation to date formats and inspired me to help her.

sparkar-dateformat's People

Contributors

nikolvs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tauphi33

sparkar-dateformat's Issues

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.