Giter Site home page Giter Site logo

alfred-relative-dates's Introduction

Relative Dates Alfred Workflow

Generate relative dates based on a simple input format and your own date formatting parameters (there are some default placeholders you can delete).

Supports multiple locales/languages.

Download & installation

Download the workflow from GitHub, then double-click the Relative-Dates-XYZ.alfredworkflow to install it in Alfred.

Usage

These are the default workflow keywords:

  • date — Generate a formatted date using the input format.
    • — Copy date to clipboard
    • ⌘+↩ — Copy date to clipboard and paste into frontmost app
  • datehelp — Open (this) help file
  • dateformats — View saved date formats
    • ⌘+↩ — Delete date format
  • dateadd — Add a new date format
    • — Save the date format
  • datereset — Reset the saved date formats to the defaults

Entering dates

(+/-)<NUM>(w|d|y) where w = week(s), d = day(s) and y = year(s)

You needn't specify a sign: + is understood as the default, so +1d and 1d mean the same thing.

Months are not supported, as it leads to ambiguity: what if today is the 31st, but the target month only has 30 days? Similarly, a year is naively defined as 365 days.

Examples

  • 0 = now = today — today's date
  • 1d — 1 day from now
  • 7d = 1w — 1 week from now
  • -21d = -3w — 3 weeks ago

Output date formats

The Workflow includes a few defaults for the locales en_US, en_GB and de_DE.

You can specify your own custom date formats using the following symbols, and you can also specify a language (locale) with the format lang=de or lang=de_DE if you want to use dates formatted for a language different to your system's.

Symbol Description Examples
%a Weekday as locale’s abbreviated name. Sun, Mon, ..., Sat (en_US); So, Mo, ..., Sa (de_DE)
%A Weekday as locale’s full name. Sunday, Monday, ..., Saturday (en_US); Sonntag, Montag, ..., Samstag (de_DE)
%w Weekday as a decimal number, where 0 is Sunday and 6 is Saturday. 0, 1, ..., 6
%d Day of the month as a zero-padded decimal number. 01, 02, ..., 31
%b Month as locale’s abbreviated name. Jan, Feb, ..., Dec (en_US); Jan, Feb, ..., Dez (de_DE)
%B Month as locale’s full name. January, February, ..., December (en_US); Januar, Februar, ..., Dezember (de_DE)
%m Month as a zero-padded decimal number. 01, 02, ..., 12
%y Year without century as a zero-padded decimal number. 00, 01, ..., 99
%Y Year with century as a decimal number. 1970, 1988, 2001, 2013
%p Locale’s equivalent of either AM or PM. AM, PM (en_US); am, pm (de_DE)
%j Day of the year as a zero-padded decimal number. 001, 002, ..., 366
%U Week number of the year (Sunday as the first day of the week) as a zero padded decimal number. All days in a new year preceding the first Sunday are considered to be in week 0. 00, 01, ..., 53
%W Week number of the year (Monday as the first day of the week) as a decimal number. All days in a new year preceding the first Monday are considered to be in week 0. 00, 01, ..., 53
%x Locale’s appropriate date representation. 08/16/88 (None); 08/16/1988 (en_US); 16.08.1988 (de_DE)
%% A literal '%' character. %

Examples

  • %d/%m/%Y — e.g. 21/01/2014
  • %A %B %d %Y — e.g. Wednesday March 12 2014
  • %A %d. %B %Y lang=de — e.g. Mittwoch 12. März 2014

Bug reports, feedback

Report any issues or feature requests either on GitHub or the Alfred Forum.

Licensing, thanks etc.

This Workflow is released under the MIT Licence.

It uses the [Alfred-Workflow] and docopt libraries, also both MIT-licensed.

alfred-relative-dates's People

Contributors

deanishe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alfred-relative-dates's Issues

Unsupported locale setting

screen shot 2014-03-21 at 15 58 27

Any idea about what could be the cause of this issue? There should not be anything fancy with my locale:

screen shot 2014-03-21 at 15 59 30

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.