6.0.4 • Published 1 year ago

@instant-ar/blockly-field-date-modified v6.0.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

blockly-field-date-modified Built on Blockly

A Blockly date picker field that uses the Google Closure date picker (goog.ui.DatePicker).

Installation

Yarn

yarn add blockly-field-date-modified

npm

npm install blockly-field-date-modified --save

Usage

JavaScript

import * as Blockly from 'blockly';
import FieldDate from 'blockly-field-date-modified';

Blockly.Blocks["test_fields_date"] = {
  init: function () {
    this.appendDummyInput()
      .appendField("date: ")
      .appendField(new FieldDate("2020-02-20"), "FIELDNAME");
  }
};

JSON

import * as Blockly from 'blockly';
import 'blockly-field-date-modified';

Blockly.defineBlocksWithJsonArray([
    {
        "type": "test_fields_date",
        "message0": "date: %1",
        "args0": [
            {
                "type": "field_date",
                "name": "FIELDNAME",
                "date": "2020-02-20"
            }
        ]
    }]);

View the developer documentation for further usage examples.

License

Apache 2.0