Takes a Date object and a string argument and replaces all strftime C-type time variables in the string with the corresponding data from the Date object.
strftime for JavaScript
TypeScript definitions for strftime
A JavaScript time formatter and parser inspired by strftime and strptime.
moment-strftime adds strftime to Moment.js
Timestamp for 64-bit time_t, nanosecond precision and strftime
A utility package for guessing date's format
Ultra fast realization of javascript strftime function without memory leak
fast php date() work-alike for nodejs
Fork of pretty-format with support for ESM
A utility package for guessing date's format
a compact calendar date
Format numbers for human consumption.
Transforms a Hapi request to a Common Log Format log line
A Stimulus Wrapper for Flatpickr library
Comprehensive strftime and strptime implementation.
[](https://www.npmjs.com/package/@aws-sdk/util-format-url) [](https://www.npmjs.com/package/@aws-sd
Stringify any JavaScript value.
Extremely fast implementation of node strftime library
Transforms a Hapi request to a Common Log Format log line
Use unquoted format on @font-face CSS definitions.
JavaScript sprintf implementation
Formatting Date objects as strings since 2013
Solves a problem with util.format
Extend Date#strftime, Time#strftime, DateTime#strftime for the JP week format.
Convenient list of strftime format directives
Generates an strftime format using human readable date.
Converts .Net formats to strftime formats
date-formatter - date formatter by example; auto-builds the strftime format string from an example date
Format dates and times based on human-friendly examples, not arcane strftime directives.
Adds strftime_roulette method to Date and Time classes, returning randomly formatted date/time strings
Render a date/time span according to an strftime pattern. Only works with sensibly ordered date-formats (so not US!)
Render a date/time span according to an strftime pattern. Only works with sensibly ordered date-formats (so not US!)
Friendly ways to format dates. Instead of looking up strftime options all the time like I do :)
This gem is still under active development. Please contact me directly with any questions or suggestions. To start: r = RedcapAPI.new(token, url) # your institution has it's own url, and each project has it's own token r.get(optional record_id) # returns all records in JSON format or a specific record if specified r.get_fields # returns all fields for that instrument r.post(data) # this will either update an old record or create a new one. the data should be in form of array of hashes or as a hash (for one item). dates are accepted in Date class or in strftime('%F') format. for example data = {name: 'this is a test', field_2: Date.today} r.post(data) # creates a new object using the fields above. field names must match those in the existing project "{\"count\": 1}" --> indicates the object posted. to update an existing record: data = {record_id: 3, name: 'this is a test to update', field_2: Date.today} r.post(data) # this will update the record with record_id 3. if record_id 3 does not exist it will create an entry with that record id
# Fancy Logger An easily customizable logger with style. ## Install ### Bundler: `gem 'fancy_logger'` ### RubyGems: `gem install fancy_logger` ## Usage Simply use as if you were using the normal Ruby `Logger` class: ```ruby require 'fancy_logger' logger = FancyLogger.new(STDOUT) logger.info "Hello" ``` ### Config The `config` instance method allows you to modify the configuration of the Logger within a DSL. Continuing with our last example: ```ruby logger.config do timestamp_format "%c" styles do info do foreground :yellow blink true end end end logger.debug 'Look here!' logger.info 'Doing things...' logger.warn 'Watch out!' logger.error 'Bad' logger.fatal 'VERY bad' logger.unknown 'Weird unknown stuff' ``` #### Output ![][output_example] ### Config ```ruby # The format of the timestamp in the log. Follows the strftime standards. timestamp_format "%F %r" # On the first logged message, FancyLogger will prepend a help message # containing a list of all the severities (debug, info, warn, etc) styled # according to your config as reference. # You can disable this by setting the below option to false. show_help_message true # Under styles, you have a configuration for each severity. # Each severity has a configuration with the following valid options: # Key: foreground # Value: # :default, :black, :red, :green, :yellow, :blue, :magenta, :cyan, :white # # Key: background # Value: # :default, :black, :red, :green, :yellow, :blue, :magenta, :cyan, :white # # Key: reset # Value: true or false # # Key: bright # Value: true or false # # Key: italic # Value: true or false # # Key: underline # Value: true or false # # Key: # blink # Value: true or false # # Key: inverse # Value: true or false # # Key: hide # Value: true or false styles do debug do foreground :black background :cyan end info do foreground :default background :default end warn do foreground :yellow background :default blink true end error do foreground :red background :default end fatal do foreground :black background :red bold true underline true end unknown do foreground :black background :white underline true end end ``` ## Contributing * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it * Fork the project * Start or switch to a testing/unstable/feature/bugfix branch * Commit and push until you are happy with your contribution * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. * Please try not to mess with the Rakefile, VERSION or gemspec. ## Copyright Copyright © 2012 Ryan Scott Lewis <ryan@rynet.us>. The MIT License (MIT) - See LICENSE for further details. [output_example]: http://oi44.tinypic.com/sfwlkp.jpg