Code Monkey home page Code Monkey logo

appianplugin-java-time's Introduction

An Appian plugin containing date and time utility functions, using concepts and behaviour from Java Time (JSR-310).

Currently, it provides functions to parse and validate text representation of local dates. Future versions may add additional functions.

Functions

The following functions are currently provided:

  • time_parseLocalDate: Parses a text representation of a local date. If the representation is invalid or constitutes an invalid date, an exception is thrown.
  • time_isValidLocalDate: Returns a boolean indicating whether the provided text is a valid representation of a date given the date pattern.

A local date is not associated to a particular time zone. It can be used to represent dates where a given time zone is assumed or to represent stand-alone date values, such as a date of birth. In Appian, a local date is known as a Date.

The date pattern follows Java's format. You may use a value such as 'yyyy-M-d'. Use 'y' for year digits, 'M' for month digits (note that it's in uppercase) and 'd' for day-of-month digits. The pattern follows what's defined in https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#patterns, with the restriction that only date-related characters are allowed. For instance, time pattern characters such as 'H' are not allowed.

Functions are prefixed with time_ as a rudimentary way to avoid names clashing with functions from other plugins.

Version

The implementation is stable, hence the version number is 1.0.0.

This plugin has been tested in Appian 18.1 and 17.4 but will most likely work in newer as well as older Appian versions.

Java Time (JSR-310) was introduced in Java 8. However, this implementation runs in Appian instances with older Java versions.

Similar Plugins

Another plugin, The Date and Time Utilities plugin, also provides date parsing and validation functions. However, the functionality in this project differs in that:

  • This project uses Java Time terminology and behaviour
  • In this project, an arbitrary date format can be specified; the other plugin uses a fixed set of patterns.
  • The return value of time_parseLocalDate is a local date (i.e., an Appian Date); the other plugin returns an instant (i.e. an Appian Date and Time).
  • In this project, if the parse fails, an exception is thrown. This is by design. If don't know whether the provided date will be valid, call time_isValidLocalDate before.

appianplugin-java-time's People

Contributors

inno-juanal avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

sangeerththan

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.