How to use the globals.TZ_REGION function in globals

To help you get started, we’ve selected a few globals examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cyverse / troposphere / troposphere / static / js / components / images / list / common / ImageCard.react.js View on Github external
render: function() {
        var image = this.props.image,
            type = stores.ProfileStore.get().get("icon_set"),
            imageTags = stores.TagStore.getImageTags(image),
            imageCreationDate = moment(image.get("start_date"))
                .tz(globals.TZ_REGION)
                .format("MMM Do YYYY hh:mm a z"),
            hasLoggedInUser = context.hasLoggedInUser(),
            iconSize = 45,
            icon;

        // always use the Gravatar icons
        icon = (
            
        );

        // Hide bookmarking on the public page
        var bookmark;
        let endDated;
        if (this.props.isEndDated) {
            endDated = (
                <div style="{{"></div>
github cyverse / troposphere / troposphere / static / js / components / images / list / common / ImageListCard.jsx View on Github external
//         metric = imageMetric.get('metrics');
        //         if (metric) {
        //             seriesData = this.getChartData(image, metric);
        //             labels = this.getLabels(metric);
        //             if (labels.length &gt; 0) {
        //                 graphDiv = ();
        //             }
        //         }
        //     }
        // }
        let imageCreationDate = moment(image.get("start_date"))
            .tz(globals.TZ_REGION)
            .format("MMM Do YY hh:mm ");

        let converter = new Showdown.Converter();

        let description = image.get("description");
        if (!description) {
            description = "No Description Provided.";
        } else if (description.length &gt; 90) {
            description = description.substring(0, 90) + " ...";
        }

        let name = image.get("name");
        if (name.length &gt; 30) {
            name = name.substring(0, 30) + " ...";
        }
github cyverse / troposphere / troposphere / static / js / components / images / detail / removed / RemovedView.jsx View on Github external
render: function() {
        var image = this.props.image,
            endDate = moment(image.get("end_date"));
        if (endDate.isValid()) {
            let formatDate = endDate
                .tz(globals.TZ_REGION)
                .format("M/DD/YYYY hh:mm a z");
            endDate = formatDate;
        } else {
            // Hide this from view when end date isn't available
            // Based on API permissions, this means only STAFF
            // and ImageOwners will see this view.
            return <div>;
        }

        return (
            <div>
                <h4>Removed:</h4>
                <p>{endDate}</p>
            </div>
        );
    }</div>
github cyverse / troposphere / troposphere / static / js / components / projects / detail / details / ViewDetails.jsx View on Github external
renderDateCreated: function(project) {
        var start_date = project
            .get("start_date")
            .tz(globals.TZ_REGION)
            .format("MMM Do YYYY hh:mm a z");
        return (
            <div>
                <h4>Created</h4>
                <p>{start_date}</p>
            </div>
        );
    },
github cyverse / troposphere / troposphere / static / js / components / common / InteractiveDateField.jsx View on Github external
setEndDateNow: function(e) {
        var now_time = moment(new Date()),
            new_value = now_time
                .tz(globals.TZ_REGION)
                .format("M/DD/YYYY hh:mm a z");
        this.setState({
            value: new_value
        });
        if (this.props.onChange != null) {
            this.props.onChange(new_value);
        }
    },
github cyverse / troposphere / troposphere / static / js / components / images / detail / versions / Version.jsx View on Github external
renderDateString(version) {
        let date_str;
        let dateCreated = moment(version.get("start_date"))
            .tz(globals.TZ_REGION)
            .format("MMM Do YY, hh:mm");

        if (version.get("end_date")) {
            let dateArchived = moment(version.get("end_date"))
                .tz(globals.TZ_REGION)
                .format("MMM Do YY, hh:mm");

            date_str = dateCreated + " - " + dateArchived;
        } else {
            date_str = dateCreated;
        }
        return date_str;
    },
github cyverse / troposphere / troposphere / static / js / components / images / detail / versions / Version.jsx View on Github external
renderDateString(version) {
        let date_str;
        let dateCreated = moment(version.get("start_date"))
            .tz(globals.TZ_REGION)
            .format("MMM Do YY, hh:mm");

        if (version.get("end_date")) {
            let dateArchived = moment(version.get("end_date"))
                .tz(globals.TZ_REGION)
                .format("MMM Do YY, hh:mm");

            date_str = dateCreated + " - " + dateArchived;
        } else {
            date_str = dateCreated;
        }
        return date_str;
    },
github cyverse / troposphere / troposphere / static / js / components / images / detail / EditImageDetails.jsx View on Github external
getInitialState: function() {
        var image = this.props.image,
            endDate = image.isEndDated()
                ? image
                      .get("end_date")
                      .tz(globals.TZ_REGION)
                      .format("M/DD/YYYY hh:mm a z")
                : "";

        var imageTags = stores.TagStore.getImageTags(image);
        var imageAccessList = stores.PatternMatchStore.getImageAccess(image);
        return {
            name: image.get("name"),
            description: image.get("description"),
            is_public: image.get("is_public"),
            accessList: imageAccessList,
            endDate: endDate,
            tags: imageTags
        };
    },